ko-nlp / Korpora

Korean corpus repository
Creative Commons Attribution 4.0 International
694 stars 80 forks source link

Make KorpusData as Iterable #19

Closed lovit closed 4 years ago

lovit commented 4 years ago

usage scenario

from Korpora import NSMC

nsmc  = NSMC()
for text, label in nsmc:
    print(type(text))  # str
    print(type(label))  # int
lovit commented 4 years ago

Korpora.KorpusData 를 상속하는 모든 데이터 클래스에서 이를 구현하면 좋을 것 같아요.

lovit commented 4 years ago

텍스트만을 가지고 오는 경우도 있으니 이는 get_all_texts() 함수로 처리하겠습니다. 이는 Korpora.Korpus.get_all_texts() 와 용도가 같습니다.