Git Product home page Git Product logo

Comments (10)

CheaSim avatar CheaSim commented on May 28, 2024 1

https://github.com/zjunlp/OpenUE/blob/main/scripts/interactive.sh 这个脚本是使用已经训练好的ner_modelseq_model进行知识抽取。
如果想对无标注的纯文本进行抽取,可以在初始化模型Inference之后使用以下代码进行抽取。

inputs = data.tokenizer("姚明出生在**。", return_tensors='pt')
print(lit_model.inference(inputs))

from openue.

CheaSim avatar CheaSim commented on May 28, 2024 1

./dataset/ske/cached_train_BertTokenizerFast_interactive是缓存训练样本用的,不会保存得到的三元组。
interactive.sh脚本是用来合并ner_modelseq_model并得到具体的比如F1的指标并不会保存抽取的三元组(计算F1后就扔了)。
如果想得到单一句子中抽取出来的三元组,可以使用lit_model.inference(inputs)单独使用模型去抽取句子的实体或者你可以在lit_model.test_steplit_model.test_epoch_end中修改代码来保存得到的三元组。

from openue.

jjjjjjjjj58 avatar jjjjjjjjj58 commented on May 28, 2024

学长我刚刚把interactive.sh跑了一边,最后的结果是会保存在./dataset/ske/cached_train_BertTokenizerFast_interactive中吗?如果是的话能否请教下如何打开这个CACHED文件0.0

from openue.

jjjjjjjjj58 avatar jjjjjjjjj58 commented on May 28, 2024

就是知识抽取出来的结果。。。

from openue.

jjjjjjjjj58 avatar jjjjjjjjj58 commented on May 28, 2024

谢谢学长

from openue.

jjjjjjjjj58 avatar jjjjjjjjj58 commented on May 28, 2024

作者你好,config在哪里设置啊,然后训练的epoch设置多少比较合适呢

from openue.

CheaSim avatar CheaSim commented on May 28, 2024

config 是根据yaml文件设置的。 如果是使用脚本运行,那么直接在运行的脚本中加入命令 --key value即可。

from openue.

jjjjjjjjj58 avatar jjjjjjjjj58 commented on May 28, 2024

请问是否所有的脚本都需 max_steps limit_train_batches max_epochs,改为 0,0(也就是不限制),和5呢,我ner.sh与seq.sh更改后都出现了的BUG,很奇怪。。。(更改前没有问题)
图片

from openue.

jjjjjjjjj58 avatar jjjjjjjjj58 commented on May 28, 2024

图片
这是SEQ.SH的结果

from openue.

CheaSim avatar CheaSim commented on May 28, 2024

针对不同的数据集需要不同的超参,有的时候需要更多的epochs,出现的那个bug检查一下test_only是否启用的,那个是用来推理的。

from openue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.