2  Loading LatinCy models

2.1 Loading LatinCy models with spaCy

# Imports

import spacy
from pprint import pprint
nlp = spacy.load('la_core_web_lg')
/Users/pjb311/.venvs/latincy/lib/python3.11/site-packages/spacy/util.py:910: UserWarning: [W095] Model 'la_core_web_lg' (3.8.0) was trained with spaCy v3.8.3 and may not be 100% compatible with the current version (3.7.5). If you see errors or degraded performance, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate
  warnings.warn(warn_msg)

2.2 Creating a spaCy doc from a string

text = "Haec narrantur a poetis de Perseo."
doc = nlp(text)
print(doc)
Haec narrantur a poetis de Perseo.
print(type(doc))
<class 'spacy.tokens.doc.Doc'>
print(doc.__repr__())
Haec narrantur a poetis de Perseo.
print(doc.text)
Haec narrantur a poetis de Perseo.
print(type(doc.text))
<class 'str'>