Instructions to use iproskurina/en_grammar_checker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- spaCy
How to use iproskurina/en_grammar_checker with spaCy:
!pip install https://huggingface.co/iproskurina/en_grammar_checker/resolve/main/en_grammar_checker-any-py3-none-any.whl # Using spacy.load(). import spacy nlp = spacy.load("en_grammar_checker") # Importing as module. import en_grammar_checker nlp = en_grammar_checker.load() - Notebooks
- Google Colab
- Kaggle
| import spacy | |
| from spacy.language import Language | |
| from pathlib import Path | |
| from spacy.util import get_model_meta | |
| model_path = Path(__file__).parent | |
| meta = get_model_meta(model_path) | |
| data_dir = f"{meta['lang']}_{meta['name']}-{meta['version']}" | |
| components_path = model_path / data_dir / "training" | |
| def vocabulary(doc): | |
| nlp_vocabulary = spacy.load(components_path/"vocabulary") | |
| return nlp_vocabulary(doc) | |
| def articles(doc): | |
| nlp_articles = spacy.load(components_path/"articles") | |
| return nlp_articles(doc) | |
| def punctuation(doc): | |
| nlp_punctuation = spacy.load(components_path/"punctuation") | |
| return nlp_punctuation(doc) | |
| def spelling(doc): | |
| nlp_spelling = spacy.load(components_path/"spelling") | |
| return nlp_spelling(doc) | |
| def grammar_major(doc): | |
| nlp_grammar_major = spacy.load(components_path/"grammar_major") | |
| return nlp_grammar_major(doc) | |
| def grammar_minor(doc): | |
| nlp_grammar_minor = spacy.load(components_path/"grammar_minor") | |
| return nlp_grammar_minor(doc) | |