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.1.tar.gz
(14.4 kB
view hashes)
Built Distribution
Close
Hashes for corpus_patterns-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0d6c31dc86f7032edf15ab724d787e236f754e43f41a8303fda7f9ee5e68211 |
|
MD5 | e9cdcad28c465c2481747be35aa1e7a2 |
|
BLAKE2b-256 | f1d05a506728124d319400481f74cc6079607b44ca7e020c1d3bc89f04d6d0fa |