@@ -133,15 +133,6 @@ fastNLP的大致工作流程如上图所示,而项目结构如下: | |||||
<td> 实现了读写功能,包括数据读入与预处理,模型读写,自动下载等 </td> | <td> 实现了读写功能,包括数据读入与预处理,模型读写,自动下载等 </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<hr> | |||||
<b>致谢</b> | |||||
感谢 [深脑云](http://www.dbcloud.ai/) 提供的模型与数据存储、下载服务。 | |||||
<a href="http://www.dbcloud.ai/"> | |||||
<img src="http://www.dbcloud.ai/static/images/logo/logo.png"> | |||||
</a> | |||||
<hr> | <hr> | ||||
@@ -243,8 +243,8 @@ def _get_base_url(name): | |||||
return url + '/' | return url + '/' | ||||
else: | else: | ||||
URLS = { | URLS = { | ||||
'embedding': "http://fudan.irocn.cn:8989/api/public/dl/", | |||||
"dataset": "http://fudan.irocn.cn:8989/api/public/dl/dataset/" | |||||
'embedding': "http://212.129.155.247/embedding/", | |||||
"dataset": "http://212.129.155.247/dataset/" | |||||
} | } | ||||
if name.lower() not in URLS: | if name.lower() not in URLS: | ||||
raise KeyError(f"{name} is not recognized.") | raise KeyError(f"{name} is not recognized.") | ||||
@@ -149,8 +149,9 @@ class Conll2003Loader(ConllLoader): | |||||
class Conll2003NERLoader(ConllLoader): | class Conll2003NERLoader(ConllLoader): | ||||
""" | """ | ||||
用于读取conll2003任务的NER数据。 | |||||
用于读取conll2003任务的NER数据。每一行有4列内容,空行意味着隔开两个句子 | |||||
支持读取的内容如下 | |||||
Example:: | Example:: | ||||
Nadim NNP B-NP B-PER | Nadim NNP B-NP B-PER | ||||
@@ -199,6 +200,8 @@ class Conll2003NERLoader(ConllLoader): | |||||
continue | continue | ||||
ins = {h: data[i] for i, h in enumerate(self.headers)} | ins = {h: data[i] for i, h in enumerate(self.headers)} | ||||
ds.append(Instance(**ins)) | ds.append(Instance(**ins)) | ||||
if len(ds) == 0: | |||||
raise RuntimeError("No data found {}.".format(path)) | |||||
return ds | return ds | ||||
def download(self): | def download(self): | ||||