提交 e5e887b0 编写于 作者: K kinghuin 提交者: wuzewu

modify tnews

上级 5c399b8e
......@@ -73,12 +73,30 @@ class TNews(HubDataset):
def get_labels(self):
return [
'news_game', 'news_sports', 'news_finance', 'news_entertainment',
'news_tech', 'news_house', 'news_car', 'news_culture', 'news_world',
'news_travel', 'news_agriculture', 'news_military', 'news_edu',
'news_story', 'stock'
'100', '101', '102', '103', '104', '106', '107', '108', '109',
'110', '112', '113', '114', '115', '116'
]
def get_label_name(self, id):
label_name = {
"100": "news_story",
"101": "news_culture",
"102": "news_entertainment",
"103": "news_sports",
"104": "news_finance",
"106": "news_house",
"107": "news_car",
"108": "news_edu",
"109": "news_tech",
"110": "news_military",
"112": "news_travel",
"113": "news_world",
"114": "stock",
"115": "news_agriculture",
"116": "news_game"
}
return label_name[id]
@property
def num_labels(self):
"""
......@@ -93,7 +111,7 @@ class TNews(HubDataset):
for line in file:
data = line.strip().split("_!_")
example = InputExample(
guid=data[0], label=data[2], text_a=data[3])
guid=data[0], label=data[1], text_a=data[3])
examples.append(example)
return examples
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册