Building blocks for spacy Matcher patterns
Project description
corpus-patterns
Create a custom tokenizer
from corpus_patterns import set_tokenizer
nlp = spacy.blank("en")
nlp.tokenizer = set_tokenizer(nlp)
The tokenizer:
- Removes dashes from infixes
- Adds prefix/suffix rules for parenthesis/brackets
- Adds special exceptions to treat dotted text as a single token
Add .jsonl files to directory
Each file will contain lines of spacy matcher patterns.
from corpus_patterns import create_rules
from pathlib import Path
create_rules(folder=Path(Path("location-here"))) # check directory
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
corpus_patterns-0.0.3.tar.gz
(14.4 kB
view hashes)
Built Distribution
Close
Hashes for corpus_patterns-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70108e2004bcb3715021dbe0ab0750dc9f8a89351508b8f111a048959912c119 |
|
MD5 | fdb957624e91526eb5146eaaf802b5bb |
|
BLAKE2b-256 | 37caa12f7bdddccb9e14bd18b93f16b51ecb01f7d92825ddcd70761946a33f8f |