Update README.md

This commit is contained in:
Cardiff NLP 2020-11-12 17:46:05 +00:00
parent c3f00119f3
commit aa7cb4cab2
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,8 @@ labels=[]
mapping_link = f"https://raw.githubusercontent.com/cardiffnlp/tweeteval/main/datasets/{task}/mapping.txt"
with urllib.request.urlopen(mapping_link) as f:
html = f.read().decode('utf-8').split("\n")
spamreader = csv.reader(html[:-1], delimiter='\t')
labels = [row[1] for row in spamreader]
csvreader = csv.reader(html, delimiter='\t')
labels = [row[1] for row in csvreader if len(row) > 1]
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)