ink-usc / triggerner Goto Github PK
View Code? Open in Web Editor NEWTriggerNER: Learning with Entity Triggers as Explanations for Named Entity Recognition (ACL 2020)
Home Page: https://arxiv.org/abs/2004.07493
TriggerNER: Learning with Entity Triggers as Explanations for Named Entity Recognition (ACL 2020)
Home Page: https://arxiv.org/abs/2004.07493
I run your new code. It seems that percentage also doesn't work in semi_supervised.py.
I run: python semi_supervised.py --device cuda:0 --dataset CONLL --percentage 20, test result F1 is 85.58.
I run: python semi_supervised.py --device cuda:1 --dataset CONLL --percentage 3, test result F1 is 86.39.
Hi!
Thanks for your code :)
I am trying to change the tagging schema from IOB to IO, by implementing a simple function which replaces "B-" with "I-", but this alteration results in 0 values for precision, recall and f1 on dev and test sets.
This is the function I added to the Config class:
def use_io(self, insts: List[Instance]) -> None:
"""
Use IO tagging schema to replace the IOB tagging schema in the instance
:param insts:
:return:
"""
for inst in insts:
output = inst.output
for pos in range(len(inst)):
curr_entity = output[pos]
if curr_entity.startswith(self.B):
output[pos] = curr_entity.replace(self.B, self.I)
I was wondering what causes this sharp drop of performance.
Hello,
I have a question regarding the trigger files. I do not completely understand the numeric ids found next to the words that are considered as triggers. For instance:
EU B-ORG
rejects T-3
German T-0
call T-4
to O
boycott T-1
British T-2
lamb T-2
. O
I understand that the words with a T are triggers regarding the entity EU. Thus, for each entity there are different triggers. However, what does mean the number next to the T? For a moment, I thought that the ids were the order in which tokens should be used. I have thought as well that they would group the triggers. A colleague though that it was different levels of triggers. But, I have seen that some examples do not contain a T-0 and, in some cases and the triggers are not numbered in specific pattern.
So, it is not completely clear the meaning of the numbers.
Hi, thanks for sharing your source code.
I have a question about the experimental results. If you use 100% sentences labeled with both entity tags and trigger
tags, what the performance will be?
1、实体触发器就是一种匹配模式?如果符合此模式那么就可以得到实体?那么此模式是否可以理解为一个词性表示在这里。
2、此方法本体上还是研究如何加强一个特征表示。
3、有一个问题是:在预测的时候,如果出现不在标注的触发词表的样本集,就是出现测试样本的触发词与标注的大不相同,那么这个方法应该没有什么用处,所以还是标注触发词的规模能够覆盖多少,难以相信 Trigger Matching Networks能够学习到发现一个句子的触发词是什么,从而进行使用。
how can I use the context_emb,Ineed your help
I run: python semi_supervised.py --device cuda:0 --dataset CONLL --percentage 20
but the result can only achieve 54.20(F1) in test set. Which command should I run can achieve over 80 F1 value?
hello!
In the soft_matcher.py file, the index on line 140 should be the position of the trigger. If you convert the position information to Word (using IDx2Word [index]), this seems to be an error.What does trigger_list stand for?
Hi,
I have just read the paper, and it's a nice work.
I have some questions:
1, To enable more efficient batch-based training, a sentence contains only one entity and one trigger? How much less efficient would it be if didn't limit this?
2, gs or gt is obtained by weighted sum of the token vectors, there's no representation of the sum in the formula ?
3, base model is CNN-BLSTM-CRF, there is no comparison in the results table ? Is that BLSTM-CRF for short?
4, What would happen if a full amount of trigger data be used?
Best Wishes
I have a question about the inconsistency between the paper and the code:
Lines 83 to 94 in c38df93
TriggerNER/model/soft_inferencer.py
Lines 19 to 29 in c38df93
TriggerNER/model/soft_inferencer.py
Lines 45 to 57 in c38df93
Hello!Thanks for your code!But I still have a question about the trigger_list
, in soft_matcher.py, 140 lines.
trigger_list.extend([" ".join(self.config.idx2word[index] for index in indices if index != 0) for indices in word_seq])
word_seq
represents the positions of triggers in each sentence.(i.e. It will always smaller than seq_len
). In that case, trigger_list
will only includes the triggers in the first several sentences, which may be a error.
Did I get it wrong, I wonder?
Thanks for your code again!
Hi,
I run your code semi_supervised.py found this error:
Traceback (most recent call last):
File "semi_supervised.py", line 191, in
main()
File "semi_supervised.py", line 188, in main
sequence_trainer.self_training(20, dataset, unlabeled_x)
File "/deepo_data/CZF/TriggerNER-master/model/soft_inferencer.py", line 219, in self_training
weaklabel, unlabel = self.weak_label_selftrain(unlabels, self.triggers)
File "/deepo_data/CZF/TriggerNER-master/model/soft_inferencer.py", line 283, in weak_label_selftrain
weakly_labeled, unlabeled, confidence = self.weakly_labeling(batched_data, unlabeled_data, triggers)
File "/deepo_data/CZF/TriggerNER-master/model/soft_inferencer.py", line 254, in weakly_labeling
batch_max_scores, batch_max_ids = self.model.decode(*batch[0:5], triggers)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 576, in getattr
type(self).name, name))
AttributeError: 'SoftSequence' object has no attribute 'decode'.
I found that the 'SoftSequence' object has no attribute 'decode' indeed. Is this a bug or a problem with my operation. Thanks!
Thanks a lot.
your method is amazing.
How to design and create my own trigger txt file if i wanna use my own set of Chinese corpus?
Hi,
I think your code may have some problems about data split and model:
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.