A Word Aligner for English
This is a word aligner for English: given two English sentences, it aligns related words in the two sentences. It exploits the semantic and contextual similarities of the words to make alignment decisions.
- Python NLTK
- The Python wrapper for Stanford CoreNLP
Installation and Usage
Install the above tools.
Change line 100 of corenlp.py, from "rel, left, right = map(lambda x: remove_id(x), split_entry)" to "rel, left, right = split_entry".
Download the NLTK stopword corpus:
python -m nltk.downloader stopwords
sudo pip install jsonrpclib
Download the aligner:
Run the corenlp.py script to launch the server:
To view the aligner in action, run testAlign.py. (Word indexing starts at 1.)