SELF-IMPROVEMENT/error 기록

[Google Colab] 코랩 텍스트 파일 불러오기 오류

DS지니 2021. 5. 30. 15:45
728x90
반응형

뉴욕타임즈 뉴스 기사 요약하기(Sequence to sequence)

from google.colab import drive
drive.mount('/content/drive')

!git clone https://github.com/hengluchang/deep-news-summarization.git

오류 : 텍스트가 불러들여 오지 않음.

Data_set = np.loadtxt('/content/deep-news-summarization/dataset/article.txt', delimiter=" ") 
Data_set = pd.read_csv('/content/deep-news-summarization/dataset/article.txt')

 

해결 :

# 뉴욕타임즈 기사 불러오기
with open('/content/deep-news-summarization/dataset/article.txt') as file_object:
  contents = file_object.read()

  print(contents)

# 기사 헤드라인 가져오기
with open('/content/deep-news-summarization/dataset/headline.txt') as file_object:
  contents = file_object.read()

  print(contents)

728x90
반응형