<jupyter_start><jupyter_text>Predicting Linguistic Annotations  Part 1<jupyter_code>import spacy
nlp = spacy.load("en_core_web_sm")
text = "It’s official: Apple is the first U.S. public company to reach a $1 trillion market value"
# Process the text
doc = nlp(text)
for token in doc:
    # Get the token text, part-of-speech tag and dependency label
    token_text = token.text
    token_pos = token.pos_
    token_dep = token.dep_
    # This is for formatting only
    print("{:<12}{:<10}{:<10}".format(token_text, token_pos, token_dep))<jupyter_output>It          PRON      nsubj     
’s          VERB      punct     
official    NOUN      ccomp     
:           PUNCT     punct     
Apple       PROPN     nsubj     
is          AUX       ROOT      
the         DET       det       
first       ADJ       amod      
U.S.        PROPN     nmod      
public      ADJ       amod      
company     NOUN      attr      
to          PART      aux       
reach       VERB      relcl     
a           DET       det       
$           SYM       quantmod  
1           NUM       compound  
trillion    NUM       nummod    
market      NOUN      compound  
value       NOUN      dobj<jupyter_text>Part 2<jupyter_code># Iterate over the predicted entities
for ent in doc.ents:
    # Print the entity text and its label
    print(ent.text, ent.label_)
spacy.explain("ORG")
spacy.explain("ORDINAL")
spacy.explain("GPE")
spacy.explain("MONEY")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06917808219178082, 'fraction_numerical': 0.00684931506849315, 'mean_word_length': 1.7934990439770555, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '471195', 'license': 'MIT', 'n_tokens_mistral': 484, 'n_tokens_neox': 470, 'n_words': 134, 'path': 'notebooks/1_predicting_linguistic_annotations.ipynb', 'repo_name': 'socd06/spacy_course', 'size': '1460'}