Coder Social home page Coder Social logo

dfki-nlp / tre Goto Github PK

View Code? Open in Web Editor NEW
108.0 108.0 12.0 45 KB

[AKBC 19] Improving Relation Extraction by Pre-trained Language Representations

Home Page: https://arxiv.org/abs/1906.03088

License: MIT License

Perl 16.86% Python 81.78% Shell 1.36%
information-extraction machine-learning multi-task-learning nlp relation-extraction transformer

tre's People

Contributors

leonhardhennig avatar marchbnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tre's Issues

dataset issue

Excuse me, how can I get the TACRED dataset or how can I get the LDC publication?
Thank you.

may the model support Chinese?

thx for your sharing of your works on the relation extraction, and i want to know if the project supports the Chinese or not , thx

How to use BERT

Hi,

How do I use BERT with this architecture?
Thank you in advance

ModuleNotFoundError: No module named '_regex'

I downloaded Trained Models to produce your paper results. However, for SemEval2010 Task 8, it is an error when evaluating:

File "/var/autofs/cl/work/TRE-master/train_utils.py", line 97, in load_model
text_encoder = pickle.load(f)
ModuleNotFoundError: No module named '_regex'

The above error is appeared when I try to run this command below:

CUDA_VISIBLE_DEVICES=0 python relation_extraction.py evaluate --dataset semeval_2010_task8 --test-file datasets/semeval_jsonl/semeval_2010_task8/test.jsonl --log-dir logs/ --save-dir logs/official_model/tre_semeval

Please help me to consider this problem. Thank you so much.

UnboundLocalError for Semeval training

The training command works well for the tacred dataset. But it didn't work for the semeval dataset.

I run the command below. datasets/semeval_jsonl stores the data.

python relation_extraction.py train \
  --write-model True \
  --masking-mode grammar_and_ner \
  --batch-size 8 \
  --max-epochs 3 \
  --lm-coef 0.5 \
  --learning-rate 5.25e-5 \
  --learning-rate-warmup 0.002 \
  --clf-pdrop 0.1 \
  --attn-pdrop 0.1 \
  --word-pdrop 0.0 \
  --dataset semeval_2010_task8 \
  --data-dir datasets/semeval_jsonl \
  --seed=0 \
  --log-dir ./logs/

The error shows:

Traceback (most recent call last):
  File "relation_extraction.py", line 453, in <module>
    'evaluate': evaluate
  File "/anaconda3/envs/py36/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/anaconda3/envs/py36/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/anaconda3/envs/py36/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "relation_extraction.py", line 302, in train
    dev_file=dev_file)
  File "/Users/smap10/Project/RE-Task/TRE/datasets/semeval_2010_task8.py", line 113, in fetch
    SemEval2010Task8._load_from_jsonl(join(path_to_data, train_file), is_test=False, masking_mode=masking_mode)
  File "/Users/smap10/Project/RE-Task/TRE/datasets/semeval_2010_task8.py", line 88, in _load_from_jsonl
    example = SemEval2010Task8.apply_masking_mode(example, masking_mode)
  File "/Users/smap10/Project/RE-Task/TRE/datasets/semeval_2010_task8.py", line 259, in apply_masking_mode
    first_entity_replace, second_entity_replace = [f'{g}-{n}' for g, n in zip(grammar_type, ner_type)]
UnboundLocalError: local variable 'grammar_type' referenced before assignment

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.