huggingface / torchMoji

😇A pyTorch implementation of the DeepMoji model: state-of-the-art deep learning model for analyzing sentiment, emotion, sarcasm etc
MIT License
917 stars 190 forks source link

fix: Minor bug in writing test_sentence.csv #4

Closed hiepph closed 7 years ago

hiepph commented 7 years ago

Fix for python 3:

Traceback (most recent call last):
  File "examples/score_texts_emojis.py", line 71, in <module>
    'Pct_1', 'Pct_2', 'Pct_3', 'Pct_4', 'Pct_5'])
TypeError: a bytes-like object is required, not 'str'

And fix for python 2:

Traceback (most recent call last):
  File "examples/score_texts_emojis.py", line 68, in <module>
    writer = csv.writer(csvfile, delimiter=',', lineterminator='\n')
TypeError: "delimiter" must be string, not unicode
thomwolf commented 7 years ago

Thanks @hiepph !