A replaCy component to manage indirect article agreement, that is, to deal with making "a" and "an" be correct so you don't have to think about them in your matches.
Project description
replaCy Article Agreer
A replaCy component to manage indirect article agreement, that is, to deal with making "a" and "an" be correct so you don't have to think about them in your matches.
Warning
This replaCy component touches suggestions
(span._.suggestions
) generated by replaCy, and assumes that they are text. This means you MUST attach add this component to the pipeline after the joiner. Otherwise, this component tries to raise ReplacyPipelineOrderError
to tell you this.
Install
poetry add replacy_article_agreer
Usage
import en_core_web_sm
from replacy import ReplaceMatcher
from replacy.db import load_json
from replacy_article_agreer import ArticleAgreer
from spacy.util import filter_spans
nlp = en_core_web_sm.load()
replaCy = ReplaceMatcher(nlp, load_json('path to match dict(s)'))
aa = ArticleAgreer()
# filtering spans first isn't strictly necessary, but recommended
replaCy.add_pipe(filter_spans, name="filter_spans", before="joiner")
replaCy.add_pipe(aa, name="article_agreer", after="joiner")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file replacy-article-agreer-0.2.0.tar.gz
.
File metadata
- Download URL: replacy-article-agreer-0.2.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Darwin/19.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942e2f9bac413bd5b002fe1ba084ca29abb9821c8686cecef0b25ff4222dcce1 |
|
MD5 | c28808fc2281f6d877107192f4a21a87 |
|
BLAKE2b-256 | be9831cd4a89d20b14251957fc7e1840c55760b15050a8948788937f6faa26d6 |
File details
Details for the file replacy_article_agreer-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: replacy_article_agreer-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Darwin/19.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4acca29168fcd0cc44d9a530b0c4c7d081edd359ec473d9178917181b067a620 |
|
MD5 | 257831bdaedd2b6a608046f69609fe70 |
|
BLAKE2b-256 | adfe97b4d8cd8c4dc86639dd7b07d379cf2635134ab8a1d06189bf6348e73fdf |