를 유용 , pyb에 textblob 또는 다른 패키지를 설치하려고하면 thon을 사용하려면 패키지를 설치할 응용 프로그램에 관리 권한을 부여해야합니다.
Pycharms를 통해 설치하는 동안 나에게도 동일한 오류가 발생했습니다. 나는 행정 권한을 부여하고 그것은 잘 작동했습니다!
pip install -U textblob
python -m textblob.download_corpora
는 유형을 가져 오려면 :
from textblob import TextBlob
예 :
text = '''
The titular threat of The Blob has always struck me as the ultimate movie
monster: an insatiably hungry, amoeba-like mass able to penetrate
virtually any safeguard, capable of--as a doomed doctor chillingly
describes it--"assimilating flesh on contact.
Snide comparisons to gelatin be damned, it's a concept with the most
devastating of potential consequences, not unlike the grey goo scenario
proposed by technological theorists fearful of
artificial intelligence run rampant.
'''
blob = TextBlob(text)
blob.tags # [('The', 'DT'), ('titular', 'JJ'),
# ('threat', 'NN'), ('of', 'IN'), ...]
blob.noun_phrases # WordList(['titular threat', 'blob',
# 'ultimate movie monster',
# 'amoeba-like mass', ...])
for sentence in blob.sentences:
print(sentence.sentiment.polarity)
# 0.060
# -0.341
blob.translate(to="es") # 'La amenaza titular de The Blob...'
나뿐만 아니라 당신이 따랐 는가 지침 – mrp
를 맥에 코퍼스를 설치하는 동안이 오류가 발생? 'pip'가 설치되어 있습니까? 설치가 더 쉬워집니다. – icedwater