- 😄 Interested in natural language processing and knowledge graph
smilelight / lightkg Goto Github PK
View Code? Open in Web Editor NEW基于Pytorch和torchtext的知识图谱深度学习框架。
License: Apache License 2.0
基于Pytorch和torchtext的知识图谱深度学习框架。
License: Apache License 2.0
[{'entity': '清明', 'type': 'Time', 'start': 0, 'end': 1}, {'entity': '清明是人', 'type': 'Time', 'start': 0, 'end': 3}, {'entity': '日子', 'type': 'Time', 'start': 8, 'end': 9}]
_____________________ ERROR collecting test_krl_transe.py _____________________
test_krl_transe.py:26: in
krl.train(train_path, model_type=model_type, dev_path=train_path, save_path='./krl_{}_saves'.format(model_type))
..........\Anaconda3\envs\python367\lib\site-packages\lightkg\krl\module.py:29: in train
train_dataset = rl_tool.get_dataset(train_path)
..........\Anaconda3\envs\python367\lib\site-packages\lightkg\krl\tool.py:31: in get_dataset
rl_dataset = TabularDataset(path, format=file_type, fields=fields, skip_header=skip_header)
..........\Anaconda3\envs\python367\lib\site-packages\torchtext\data\dataset.py:271: in init
examples = [make_example(line, fields) for line in reader]
..........\Anaconda3\envs\python367\lib\site-packages\torchtext\data\dataset.py:271: in
examples = [make_example(line, fields) for line in reader]
..........\Anaconda3\envs\python367\lib\site-packages\torchtext\utils.py:130: in unicode_csv_reader
csv.field_size_limit(sys.maxsize)
E OverflowError: Python int too large to convert to C long
------------------------------- Captured stderr -------------------------------
[2019-11-13 16:58:36] [INFO] [MainThread] [tool.py:30] loading dataset from C:\Users\Administrator\work\jupyter\study\Untitled Folder\kre\train.sample.csv
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
=========================== 1 error in 3.36 seconds ===========================
Process finished with exit code 0
我的数据和你的一样
科学,包涵,自然、社会、思维等领域
科学,外文名,science
科学,拼音,kē xué
科学,中文名,科学
科学,解释,发现、积累的真理的运用与实践
语法学,外文名,syntactics
语法学,中文名,语法学
物理宇宙学,对象,大尺度结构和宇宙形成
物理宇宙学,时间,二十世纪
物理宇宙学,所属,天体物理学
物理宇宙学,中文名,物理宇宙学
曹禺,出生地,天津
曹禺,毕业院校,清华大学
曹禺,逝世日期,1996年(丙子年)12月13日
曹禺,中文名,万家宝
曹禺,国籍,**
阅读了源代码,对于预训练字向量文件是指根据自己的数据集得到的enbedding 矩阵还是可以直接使用网上下载的预训练字向量文件
您好,可以提供下/home/lightsmile/NLP/corpus/kg/baike/train.sample.csv'这个数据集吗,感谢!
在windos报错:RuntimeError: method 'detach' already has a docstring
请问是torch版本兼容的问题吗 用官网指令anaconda安装的torch 然后在terminal安装lighted时候一直报错失败
错误如下
ERROR: Could not find a version that satisfies the requirement torch==1.0.0 (from lightKG) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.0.0 (from lightKG)
请教下,您把知识存储到什么到什么数据库了?Neo4j吗
您好 经过几天学习您的代码之后 我尝试在您的代码基础上实现简单的基于梯度攻击的知识图谱攻击
然后我想用求head+relation-tail关于head的导数以确定用于攻击的扰动 就应该用对应的词向量来运算
但是您代码中的self._entity_vocab貌似只是一个保存着词的列表 torch.tensor([self._entity_vocab.stoi[head]])获得的也只是一个关于该词的序号 那么我该怎么获得关于这个词的vectors的向量呢
新手入门尚在学习还请不吝赐教
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.