Comments (5)
这相当于在做笛卡尔积,sta和end的区分是看你concat的先后顺序来定的
from pfn.
前辈请教一下, 上面您说的这种类似笛卡尔积的inference方法是在哪篇论文里面最开始提出来的?
能否给推荐一篇论文,我刚刚入门关系抽取,想学习学习,因为找了半天没找到,而您论文里面对这块也没有详细介绍。 万分谢谢!
from pfn.
我基于您的模型做一些改动,但是在这块给卡住了
from pfn.
其实头和尾特征还是一样的东西,只不过通过维度扩展对齐了,比如说原来有1,2,3三个字符,通过扩展可以组成全部的组合11,12,13,21,22,。。。,这样就可以对三个字符组成的全部组合分类
from pfn.
@kaifangDeng 谢谢您,这块的特征方法搞明白了。
之前对evaluate里面的关系预测还是有点生疏,今晚又看了一下,理解了一些。谢谢
` def get_trip_pred(self, ner_pred, re_pred):
ner_mask = torch.sum(ner_pred, dim=1).float()
ner_mask = torch.sum(ner_mask, dim=-1).float()
ner_mask = torch.where(ner_mask > 0, torch.ones_like(ner_mask), torch.zeros_like(ner_mask))
seq_len = ner_mask.size(0)
e1 = ner_mask.unsqueeze(0).repeat(seq_len, 1, 1)
e2 = ner_mask.unsqueeze(1).repeat(1, seq_len, 1)
ner_mask = e1 * e2
ner_mask = ner_mask.unsqueeze(-1).repeat(1, 1, 1, len(self.rel2idx))
complete_re_pred = re_pred * ner_mask
return complete_re_pred`
from pfn.
Related Issues (20)
- Question about the tail re unit HOT 6
- 有一个报错问题,不知道是环境不对还是, HOT 5
- Small inconsistency, or not? HOT 1
- question about eval_metric HOT 1
- When training model, is it necessary to set args.do_eval=True?
- FileNotFoundError: [Errno 2] No such file or directory: 'data/data/NYT/ner2idx.json' HOT 1
- OOM for my own bigger datasets HOT 2
- Question about entity extraction of out-of-triples HOT 1
- chinese custom dataset HOT 2
- evaluate the model with customized input HOT 2
- 请问消融实验的编码模式encoding scheme应该怎么设置呀 HOT 2
- Nest下的处理 HOT 2
- SEMEVAL dataset HOT 1
- 为什么PFN-nested model在关系训练时候可以利用实体tail信息呢? HOT 2
- 你好,能否提供适用于nested-pfn的inference.py呢?感谢! HOT 1
- 关于实验结果复现的问题 HOT 2
- 关于实体抽取和关系抽取F1分数问题 HOT 2
- 关于OOT(Out-of-triple)数据集问题 HOT 2
- RuntimeError: CUDA error: device-side assert triggered
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 pfn.