spacy-transformerspip install "spacy>=3.8.11,<3.9.0" "numpy<2" spacy-transformers huggingface_hub1python - << 'PY'
2import spacy
3from huggingface_hub import snapshot_download
4
5def load_panmiqi_spacy_deberta():
6 repo_id = "panmiqi/spacy-deberta"
7 local_dir = snapshot_download(repo_id)
8 return spacy.load(local_dir)
9
10nlp = load_panmiqi_spacy_deberta()
11
12text = "U.N. official Patrick heads for Beijing."
13doc = nlp(text)
14
15print([(ent.text, ent.label_) for ent in doc.ents])
16PY