How to use the konlpy.tag.Okt function in konlpy

To help you get started, we’ve selected a few konlpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github konlpy / konlpy / test / test_openkoreantext.py View on Github external
def tkorean_instance():
    from konlpy.tag import Okt
    t = Okt()
    return t
github ratsgo / embedding / preprocess / supervised_nlputils.py View on Github external
def get_tokenizer(tokenizer_name):
    if tokenizer_name == "komoran":
        tokenizer = Komoran()
    elif tokenizer_name == "okt":
        tokenizer = Okt()
    elif tokenizer_name == "mecab":
        tokenizer = Mecab()
    elif tokenizer_name == "hannanum":
        tokenizer = Hannanum()
    elif tokenizer_name == "kkma":
        tokenizer = Kkma()
    elif tokenizer_name == "khaiii":
        tokenizer = KhaiiiApi()
    else:
        tokenizer = Mecab()
    return tokenizer
github NLP-kr / tensorflow-ml-nlp / 6.CHATBOT / Appendix / data.py View on Github external
def prepro_like_morphlized(data):
    # 형태소 분석 모듈 객체를
    # 생성합니다.

    morph_analyzer = Okt()
    # 형태소 토크나이즈 결과 문장을 받을
    #  리스트를 생성합니다.
    result_data = list()
    # 데이터에 있는 매 문장에 대해 토크나이즈를
    # 할 수 있도록 반복문을 선언합니다.
    for seq in tqdm(data):
        # Twitter.morphs 함수를 통해 토크나이즈 된
        # 리스트 객체를 받고 다시 공백문자를 기준으로
        # 하여 문자열로 재구성 해줍니다.
        morphlized_seq = " ".join(morph_analyzer.morphs(seq.replace(' ', '')))
        result_data.append(morphlized_seq)

    return result_data
github NLP-kr / tensorflow-ml-nlp / 6.CHATBOT / 6.3 seq2seq / data.py View on Github external
def prepro_like_morphlized(data):
    morph_analyzer = Okt()
    result_data = list()
    for seq in tqdm(data):
        morphlized_seq = " ".join(morph_analyzer.morphs(seq.replace(' ', '')))
        result_data.append(morphlized_seq)

    return result_data
github gusdnd852 / Chatbot / base / data_managers / data_manager.py View on Github external
def __init__(self):
        super().__init__()
        self.okt = Okt()
        for key, val in config.DATA.items():
            setattr(self, key, val)
github lovit / customized_konlpy / ckonlpy / tag / _twitter.py View on Github external
def __init__(self, dictionary=None, templates=None, use_twitter_dictionary=True):
        super().__init__(dictionary, templates, tagset)
        self._base = KoNLPyTwitter()
        self.use_twitter_dictionary = use_twitter_dictionary
        if use_twitter_dictionary:
            self._load_default_dictionary()
        self.template_tagger = SimpleTemplateTagger(self.dictionary, templates)