5. Exemplos comerciais
• ”The market for text analytics alone may rise to $978 million in 2014 from $499 million in
2011.” – De acordo com um relatório da Forrester Research (FORR).
• “During the Super Bowl, Kia went from a 4 percent share of the overall conversations
about autos to 9 percent. Positive sentiment increased from 4 percent to 18 percent, and the
trend continued in the following week” – Vice-Presidente da KIA Michael Sprague
6. Minimum Edit Distance
• Usado em correção de texto
• Número mínimo de operações para transformar uma palavra noutra
• Aural & Oral
• Levenshtein – substituições têm peso 2
7. Naive Bayes Algorithm
• Um dos mais importantes algoritmos de Classificação de texto
• Baseia-se na noção de uma “Bag of Words”
• Algoritmo probabilístico
8. Exemplo Naive Bayes
Documento Palavras Classe
1 Games Sony Japan A
2 Sony Japan A
3 Nintendo Games Japan B
4 Games Sony Nintendo Japan
Japan
?
P(Classe X) =
(𝑛º 𝐷𝑜𝑐𝑢𝑚𝑒𝑛𝑡𝑜𝑠 𝑐𝑙𝑎𝑠𝑠𝑒 𝑋)
(𝑛º 𝑡𝑜𝑡𝑎𝑙 𝑑𝑒 𝑑𝑜𝑐𝑢𝑚𝑒𝑛𝑡𝑜𝑠)
P(Palavra Y|X)=
(𝑝𝑎𝑙𝑎𝑣𝑟𝑎𝑠 𝑌 𝑒𝑚 𝑋) + 1
(𝑡𝑜𝑡𝑎𝑙 𝑝𝑎𝑙𝑎𝑣𝑟𝑎𝑠)+|𝑝𝑎𝑙𝑎𝑣𝑟𝑎𝑠 𝑑𝑖𝑠𝑡𝑖𝑛𝑡𝑎𝑠+1|
P(Games|A) =
2
9
P(Games|B) =
2
7
P(Sony|A) =
3
9
P(Nintendo|B) =
2
7
P(Japan | A) =
3
9
P(Japan|B) =
2
7
P(A|D4) =
2
3
∗
2
9
∗
3
9
∗
3
9
2
= 0.005487
P(B|D4) =
1
3
∗
2
7
∗
2
7
∗
2
7
2
= 0.002221