Coder Social home page Coder Social logo

dfki-nlp / defx Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 856 KB

[SemEval 2020] Defx at SemEval-2020 Task 6: Joint Extraction of Concepts and Relations for Definition Extraction

License: MIT License

Jsonnet 8.65% Python 11.11% Jupyter Notebook 80.09% Shell 0.16%

defx's Introduction

Joint Extraction of Concepts and Relations for Definition Extraction

Source code for the submission on the shared task of Semeval 2020 Task 8 (DeftEval): Extracting term-definition pairs on the DEFT Corpus, an english textbook corpus. The accompanying paper "Defx at SemEval-2020 Task 6: Joint Extraction of Concepts and Relations for Definition Extraction" by Marc Hübner, Christoph Alt, Robert Schwarzenberg, Leonhard Hennig can be found here: https://www.aclweb.org/anthology/2020.semeval-1.92/

Prerequisites

Tested with Python 3.7.4:

pip install -r requirements.txt
python -m spacy download en_core_web_lg

Preprocessing the data

Clone the deft corpus:

git clone https://github.com/adobe-research/deft_corpus data/deft_corpus

Run the preprocessing script:

CUDA_VISIBLE_DEVICES=0 bash scripts/preprocess.sh

Training a new model

Set the random seed (ALLENNLP_SEED) and the cuda device (ALLENNLP_DEVICE) for training:

CUDA_VISIBLE_DEVICES=0 \
ALLENNLP_SEED=0 \
ALLENNLP_DEVICE=0 \
allennlp train configs/joint_bert_classifier.jsonnet \
  --include-package defx \
  -s data/runs/joint_model

Evaluating a trained model

python scripts/evaluate.py \
  --cuda-device 0 \
  --subtasks 2 \
  --split dev \
  data/runs/joint_model

Running a demo

pip install streamlit
streamlit run streamlit_demo.py -- data/runs/joint_model/model.tar.gz

defx's People

Contributors

leonhardhennig avatar marchbnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jl1600

defx's Issues

Providing a script to preprocess text file(s) and output term/definition pairs.

This looks very useful, I was able to build the model, however I haven't figured out how to have a script take unformatted text file(s) (not belonging to the DEFT corpus), and preprocess them, run the model and output terms and their definitions - if that is even possible. That would be very useful. I saw the prediction_analysis notebook, and thought that maybe that would contain enough information to write the script I am looking for, but was unable to figure it out (since I don't know Python or Jupyter). (My use-case for definition extraction is (mathematical) knowledge management and intelligent tutoring systems - trying to populate a concept ontology). Thanks!

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.