wisdomify / storyteller

An Elsaticsearch-powered forward-dictionary of Korean proverbs
3 stars 0 forks source link

ai-hub 짝수번째 데이터 전처리 및 업로드 #9

Closed teang1995 closed 2 years ago

teang1995 commented 3 years ago

TL;DR

WHY?

왜 업로드 하는지?

왜 전처리 해야하는지?

WHAT?

TODOs

teang1995 commented 3 years ago

도서 자료 기계 독해 - 문장만 빼오기

for json_file_name in os.listdir(data_dir):
    json_path = path.join(data_dir, json_file_name)
    with open(json_path, 'r', encoding='utf-8') as json_file:
        json_data = json.load(json_file)
        sentences_info = json_data['sentence']
        for sentence_info in sentences_info:
            sentence = sentence_info['text']
            if sentence.endswith('.'):
                print(sentence)
'''
result

케냐 공화국 또는 케냐(Kenya)는 동아프리카의 공화국이다.
인도양에 면해 있으며 북동쪽으로 소말리아, 북쪽으로 에티오피아와 남수단, 서쪽으로 우간다, 남쪽으로 탄자니아와 국경을 맞닿고 있다.
수도는 나이로비이며 공용어는 영어와 스와힐리어이다.
케냐의 주요 종족은 키쿠유족, 루히아족, 루오족, 칼렌진족, 캄바족, 키시족,메루족 등 여러 민족으로 구성되어 있어 각각 다른 언어를 사용한다.
백인, 인도인, 아랍인 등 비아프리카계 민족은 전체 인구의 1% 정도를 차지한다.
인구는 4,403만 명(2013년 7월,CIA 추정자료)이다.
동아프리카에서 발견된 화석에 따르면 조상이 2백만 년 전 이 지역에서 살았다고 한다.
투르카나 호 근처에서의 최근 발굴에 따르면 호모 하빌리스(Homo habilis), 호모 에렉투스(Homo erectus)와 같은 호미니드인(hominid)이 260만 년 전 이 나라 땅에 있었다.
케냐의 식민 시대 역사는 1885년 독일이 잔지바르(현 탄자니아의 잔지바르 섬) 술탄의 케냐 해안 영토에 보호령을 설치한 것으로 시작되었다.
...
'''
teang1995 commented 3 years ago

자유대화 음성(소아, 유아)

image 앗.. 용량 멈춰! 일단 보류

ArtemisDicoTiar commented 3 years ago

@teang1995 용택님! gcp에 다운로드 다해놔서 제가 작성한 클래스로 다운받으면 될거같아요!

https://github.com/wisdomify/storyteller/blob/de6f3d48178c5812f22f643f417fdc129c20988a/storyteller/utils/gcp_dataloader.py#L129-L130

ArtemisDicoTiar commented 2 years ago