This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
In this code
import spacy
txt = 'List is a ubiquitous data structure in the Python programming language.'
nlp = spacy.load('en') doc = nlp(txt) for t in doc: print(t.text, t.head.text)
I know that the t is usually a variable assigned to each thing on a list and in this case it’s assigned to each word I know the loop is iterating through the string basically.My question is what does the t have to do in t.text and etc it just apart of the spacy library or can it be used else in my other programming. I tried to make a simple for loop in my ide
Greeting = “hello”
For I in range(5): print(I.greeting)
But it gives me an attribute error.So thinking it’s just a spacy thing!Would love to hear someone more knowledgeable opinion
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnpython...