Questão de TI - Ciência de Dados e Inteligência Artificial — NLTK (Natural Language Toolkit) — FCC 2023
TI - Ciência de Dados e Inteligência ArtificialNLTK (Natural Language Toolkit)
- Código
- fc144581
- Banca
- FCC
- Órgão
- TJ BA
- Ano
- 2023
- Cargo
- AJ ( )
Considere o código Python a seguir: import nltk from nltk.sentiment import SentimentIntensityAnalyzer s = SentimentIntensityAnalyzer () frase = "Hoje estou animado" resultado = s-polarity_scores (frase) print ("Sentimento:", resultado) Executado em condições ideais, a saída será semelhante a:
- ASentimento: { 'positive' }
- BSentimento: { 'negative' : 0.0, 'positive' : 1 }
- CSentimento: { 'neg' : 0.0, 'neu' : 0.318, 'pos' : 0.682, 'compound' : 0.4588}
- DSentimento: { 'negative' : 0.1, 'positive' : 0,4588, 'average': 0.2794}
- ESentimento: { 'positive' : no, 'positive' : yes}