GithubHelp home page GithubHelp logo

ryanelliott10 / neuralcorefres Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 85 KB

Coreference resolution using the Stanford CoreNLP library and a LSTM RNN architecture.

License: MIT License

Python 100.00%
coreference-resolution neural-networks nlp

neuralcorefres's Introduction

NeuralCorefRes

Coreference resolution using a CNN/LSTM neural network.

Ryan Elliott

Usage

Training

Training requires the data directory to, at the very least, containg the following paths:

  • data/PreCo_1.0/custom_dps/train_b<n>.json
  • data/models/word_embeddings/preco-vectors.model

You can then proceed to run python3 generate_data.py -t. Please note this command will not train on the entire dataset. This has been limited to one file to avoid requiring the use of batches. If the program is terminated before it's able to start training, reduce the number of training samples. This can be done by adding an optional flag, --samples <num>.

Predictions

Run python3 generate_data.py -p "This is a sentence that should be predicted on."

StanfordCoreNLP

Download the Stanford CoreNLP and CoreNLP server utility here. Unzip the file and move to a data directory by running the following commands:

touch data/ && mv <path/to/download/location>/stanford-corenlp-full-2018-10-05 data/

To start the server and begin using the utility, run the following:

java -cp "./<path/to/data/directory>/stanford-corenlp-full-2018-10-05/*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000

Since I understand it can be confusing trying to traverse other's file hiearchies, the following is the output of my running tree -d -I 'scripts|v4|patterns|sutime|...<directories_i_want_to_hide>' in the root directory:

.
├── LICENSE
├── README.md
├── data
│   ├── conll-2012
│   └── stanford-corenlp-full-2018-10-05
│       ...
├── neuralcorefres
│   ├── feature_extraction
│   │   ├── __init__.py
│   │   ├── gender_classifier.py
│   │   └── stanford_parser.py
│   └── test.py
├── requirements.txt
└── tests
    └── test_feature_extraction.py

8 directories, 53 files

Using the above file hierarchy, I run the below command from ./ to start the Stanford CoreNLP server:

java -cp "./data/stanford-corenlp-full-2018-10-05/*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000

Code Conventions

Typing

All code in this repo makes use of PEP 484, Python3 type hints. Generally, typing variables within functions is redundant and leads to excessive typing. Therefore, types are typically only explicitly stated in function signatures. However, per any rule in computer science, there are exceptions; if a variable is particularly ambiguous, explicitly stating its types makes sense should be encouraged.

neuralcorefres's People

Contributors

dependabot[bot] avatar ryanelliott10 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.