Comments (10)
https://github.com/zjunlp/OpenUE/blob/main/scripts/interactive.sh
这个脚本是使用已经训练好的ner_model
和seq_model
进行知识抽取。
如果想对无标注的纯文本进行抽取,可以在初始化模型Inference
之后使用以下代码进行抽取。
inputs = data.tokenizer("姚明出生在**。", return_tensors='pt')
print(lit_model.inference(inputs))
from openue.
./dataset/ske/cached_train_BertTokenizerFast_interactive
是缓存训练样本用的,不会保存得到的三元组。
interactive.sh
脚本是用来合并ner_model
和seq_model
并得到具体的比如F1
的指标并不会保存抽取的三元组(计算F1后就扔了)。
如果想得到单一句子中抽取出来的三元组,可以使用lit_model.inference(inputs)
单独使用模型去抽取句子的实体或者你可以在lit_model.test_step
和lit_model.test_epoch_end
中修改代码来保存得到的三元组。
from openue.
学长我刚刚把interactive.sh跑了一边,最后的结果是会保存在./dataset/ske/cached_train_BertTokenizerFast_interactive中吗?如果是的话能否请教下如何打开这个CACHED文件0.0
from openue.
就是知识抽取出来的结果。。。
from openue.
谢谢学长
from openue.
作者你好,config在哪里设置啊,然后训练的epoch设置多少比较合适呢
from openue.
config
是根据yaml
文件设置的。 如果是使用脚本运行,那么直接在运行的脚本中加入命令 --key value
即可。
from openue.
请问是否所有的脚本都需 max_steps limit_train_batches max_epochs,改为 0,0(也就是不限制),和5呢,我ner.sh与seq.sh更改后都出现了的BUG,很奇怪。。。(更改前没有问题)
from openue.
from openue.
针对不同的数据集需要不同的超参,有的时候需要更多的epochs
,出现的那个bug检查一下test_only
是否启用的,那个是用来推理的。
from openue.
Related Issues (20)
- 模型训练中断 HOT 3
- predict_online.py没有找到捏 HOT 1
- 新版本改动有点多啊 HOT 1
- 按照ske.ipynb的流程测试,但是F1值为0,ner和seq的指标值也很低,这个是什么原因 HOT 2
- 一些运行在Google Colab的问题 HOT 5
- colab模型路径保存问题 HOT 1
- 找不到setup_config.json HOT 5
- 请问ske.ipynb中的数据集../dataset/ske/train.json可以提供吗?原始下载路径http://lic2019.ccf.org.cn/kg似乎失效 HOT 1
- ske.ipynb中的推理config名字是否错了 HOT 1
- 源代码能做事件抽取吗 HOT 2
- colab无法做验证模型 HOT 1
- loss不变 HOT 2
- 运行 run_ner/seq.sh 无反应,并没有下载对应的 ./dataset HOT 1
- run_seq.sh报错:Can't pickle local object 'get_linear_schedule_with_warmup.<locals>.lr_lambda' HOT 1
- ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' HOT 2
- 请问一下用于事件抽取的数据集格式 HOT 2
- 数据集格式问题 HOT 1
- openue是pipeline方法还是联合抽取方法? HOT 1
- AttributeError: type object 'Trainer' has no attribute 'add_argparse_args' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openue.