问题描述
Source Repository Reader
什么是 from joblib import Parallel,delayed
from collections import OrderedDict
from torchtext.data import Dataset,Example,RawField,Field,NestedField
self.raw_content = RawField()
self.id = RawField()
self.raw_abstract = RawField(is_target=True)
self.content = NestedField(Field(fix_length=80),fix_length=50)
self.abstract = NestedField(Field())
self.abstract.is_target = True
self.fields = { "article": [("raw_content",self.raw_content) ("content",self.content)],"abstract": [ ("raw_abstract",self.raw_abstract)("abstract",self.abstract),],"id": [("id",self.id)]}
def load_fname(fname,reading_path,fields):
fpath = os.path.join(reading_path,fname)
with open(fpath,"r") as data:
ex = Example.fromJSON(data.read(),fields)
return (ex,fpath)
的等价物,但带有拥抱脸 (https://github.com/huggingface)?我需要通过一些转换器更改机器学习模型中的一些 lstm。现在,要走的路是使用转换器对数据进行预处理。
编辑
Example.fromJSON(data.read(),fields)
来源:https://huggingface.co/docs/datasets/loading_datasets.html
我想我将不得不使用上面的代码,但仍然不确定。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)