Skip to content

Commit

Permalink
ERRANT v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Bryant committed Aug 14, 2020
1 parent 9992e0a commit 2a08f30
Show file tree
Hide file tree
Showing 12 changed files with 363 additions and 52 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,12 @@

This log describes all the changes made to ERRANT since its release.

## v2.2.2 (14-08-20)

1. Added a copy of the NLTK Lancaster stemmer to `errant.en.lancaster` and removed the NLTK dependency. It was overkill to require the entire NLTK package just for this stemmer so we now bundle it with ERRANT.

2. Replaced the deprecated `tokens_from_list` function from spaCy v1 with the `Doc` function from spaCy v2 in `Annotator.parse`.

## v2.2.1 (17-05-20)

Fixed key error in the classifier for rare spaCy 2 POS tags: _SP, BES, HVS.
Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,4 +1,4 @@
# ERRANT v2.2.1
# ERRANT v2.2.2

This repository contains the grammatical ERRor ANnotation Toolkit (ERRANT) described in:

Expand Down Expand Up @@ -37,7 +37,7 @@ source errant_env/bin/activate
pip3 install errant
python3 -m spacy download en
```
This will create and activate a new python3 environment called `errant_env` in the current directory. `pip` will then install ERRANT, [spaCy](https://spacy.io/), [NLTK](http://www.nltk.org/), [python-Levenshtein](https://pypi.org/project/python-Levenshtein/) and spaCy's default English model in this environment. You can deactivate the environment at any time by running `deactivate`, but must remember to activate it again whenever you want to use ERRANT.
This will create and activate a new python3 environment called `errant_env` in the current directory. `pip` will then install ERRANT, [spaCy](https://spacy.io/), [python-Levenshtein](https://pypi.org/project/python-Levenshtein/) and spaCy's default English model in this environment. You can deactivate the environment at any time by running `deactivate`, but must remember to activate it again whenever you want to use ERRANT.

#### ERRANT and spaCy 2

Expand Down
4 changes: 0 additions & 4 deletions demo/cor1.txt

This file was deleted.

4 changes: 0 additions & 4 deletions demo/cor2.txt

This file was deleted.

5 changes: 0 additions & 5 deletions demo/orig.txt

This file was deleted.

25 changes: 0 additions & 25 deletions demo/out.m2

This file was deleted.

7 changes: 0 additions & 7 deletions demo/readme.md

This file was deleted.

2 changes: 1 addition & 1 deletion errant/__init__.py
Expand Up @@ -3,7 +3,7 @@
from errant.annotator import Annotator

# ERRANT version
__version__ = '2.2.1'
__version__ = '2.2.2'

# Load an ERRANT Annotator object for a given language
def load(lang, nlp=None):
Expand Down
3 changes: 2 additions & 1 deletion errant/annotator.py
@@ -1,5 +1,6 @@
from errant.alignment import Alignment
from errant.edit import Edit
from spacy.tokens import Doc

# Main ERRANT Annotator class
class Annotator:
Expand All @@ -21,7 +22,7 @@ def parse(self, text, tokenise=False):
if tokenise:
text = self.nlp(text)
else:
text = self.nlp.tokenizer.tokens_from_list(text.split())
text = Doc(self.nlp.vocab, text.split())
self.nlp.tagger(text)
self.nlp.parser(text)
return text
Expand Down
2 changes: 1 addition & 1 deletion errant/en/classifier.py
@@ -1,6 +1,6 @@
from pathlib import Path
import Levenshtein
from nltk.stem import LancasterStemmer
from errant.en.lancaster import LancasterStemmer
import spacy
import spacy.symbols as POS

Expand Down

0 comments on commit 2a08f30

Please sign in to comment.