Professional Documents
Culture Documents
Rafael H. Vareto
2021
Processamento de Linguagem Natural
Bootcamp Arquiteto(a) de Machine Learning
Rafael H. Vareto
© Copyright do Instituto de Gestão e Tecnologia da Informação.
Todos os direitos reservados.
3.3. Tokenização................................................................................................... 32
Referências............... ............................................................................................... 43
Vocabulário 1.1 — Língua1. (i) Conjunto dos elementos que constituem a linguagem
falada ou escrita peculiar a uma coletividade; idioma: a língua portuguesa. (ii) Sistema
de vocabulário e sintaxe usado em determinada época, por certos escritores, em uma
ou outra profissão etc.; linguagem: a língua do séc. XVI.
1 https://www.dicio.com.br/lingua/
Uma das formas de se estruturar uma linguagem, seja ela natural ou formal,
é através de sintagmas. Sintagmas nada mais são do que componentes da língua
que se encaixam na categoria sintática do termo principal de uma dada frase ou
sentença. Dentre eles, destacamos sintagmas nominais (SN) e sintagmas verbais
(SV), que possuem como principal constituinte substantivos (nomes) e verbos,
respectivamente. Léxicos e Gramáticas fazem grande uso dessas unidades
linguísticas.
1.1.1. Léxico
Línguas utilizam léxicos, que nada mais são do que dicionários contendo
os termos utilizados e suas respectivas características:
‒ CANETA
• <categoria> = substantivo
• <gênero> = feminino
• <número> = singular
‒ PUBLICOU
• <cat> = verbo
• <número> = singular
• <pessoa> = 3
• <arg1> = SN
• <arg2> = SN
1.1.2. Gramática
▪ Exemplo 1.2 Demonstrativo de uma regra que traz consigo restrições que
delimitam quais valores um sintagma nominal pode assumir para que a frase
permaneça válida [41].
‒ SN → Subst Adj
▪ Possui uma sintaxe bem definida de tal maneira que, dada uma sentença,
sempre é possível determinar se ela pertence ou não à linguagem.
2 https://www.dicio.com.br/linguagem/
1.2.1. Gramática
G = (V, Σ, R, P)
V ={0,1,2,3,S,A}
Σ ={0,1,2,3}
P ={S}
S ⇒ 0S33 (regra 1)
⇒ 00S3333 (regra 1)
⇒ 00A3333 (regra 2)
⇒ 003333 (regra 4)
⇒ 00S3333 (regra 1)
⇒ 00A3333 (regra 2)
⇒ 00123333 (regra 3)
3 https://www.dicio.com.br/algoritmo/
1.3.1. Sintaxe
▪ Exemplo 1.4 Neste exemplo, a gramática é constituída por regras que incidem
sobre determinados elementos da língua portuguesa:
<frase> → <sujeito><verbo><objeto>
<sujeito> → O escritor
<sujeito> → A jornalista
<verbo> → rasgou
<verbo> → redigiu
<adjetivo> → maçante
<adjetivo> → excelente
<adjetivo> → ε
4 https://docs.python.org/3/reference/grammar.html
1.4.1. Python
5 https://www.nltk.org/
6 https://textblob.readthedocs.io/
7 https://spacy.io/
8 https://radimrehurek.com/gensim/
9 https://stanfordnlp.github.io/CoreNLP/
10 https://vareto.com.br/python-tutorial.html
2.2.1. Linguística
11 https://www.dicio.com.br/linguistica/
Inteligência e Aprendizado
Vocabulário 2.2 — Ambiguidade12. (i) Qualidade daquilo que possui ou pode possuir
diferentes sentidos, do que é incerto ou indefinido; natureza do que é ambíguo. (ii)
Duplicidade de sentidos; característica de alguns termos e sentenças que expressam
mais de uma acepção ou entendimento possível: a ambiguidade faz parte da poesia.
12 https://www.dicio.com.br/ambiguidade/
▪ Formatação HTML;
▪ Pontuação e acentos;
▪ Caracteres especiais;
▪ Dígitos numéricos.
3.3. Tokenização
3.4. Normalização
Esses métodos retornam uma nova string onde a mesma possui todos os
caracteres na forma minúscula ou maiúscula.
13 https://www.ranks.nl/stopwords/portuguese
A biblioteca Gensim fornece uma maneira mais simples e direta para remoção
de palavras vazias, realizando a tokenização e filtragem de forma automática.
3.4.2. Stemização
3.4.3. Lematização
3.5. Representações
14 https://vareto.com.br/python-nlp-preprocessing.html
Rafael H. Vareto.
BACKUS, John W. et al. Revised report on the algorithmic language ALGOL 60. The
Computer Journal, Oxford, v. 5, n. 4, p. 349-367, jan.1963. Disponível em:
https://academic.oup.com/comjnl/article/5/4/349/316410. Acesso em: 23 jun. 2021.
(ver página 10).
CHEN, Yukun et al. A study of active learning methods for named entity recognition in
clinical text. Journal of Biomedical Informatics, [Amsterdam], v. 58, p. 11-18, dec.
2015. Disponível em:
https://www.sciencedirect.com/science/article/pii/S1532046415002038. Acesso em:
23 jun. 2021. (ver página 16).
CHOMSKY, Noam. Three models for the description of language. IRE Transactions
on Information Theory, Piscataway, v. 2, n. 3, p. 113-124, sep. 1956. Disponível em:
https://ieeexplore.ieee.org/document/1056813. Acesso em: 23 jun. 2021. (ver páginas
5, 9).
HAN, Song Han et al. Ese: Efficient speech recognition engine with sparse LSTM on
FPFA. In: ACM/SIGDA INTERNATIONAL SYMPOSIUM ON FIELD-
PROGRAMMABLE GATE ARRAYS, 2017, Monterey. Proceedings [...]. Association
for Computing Machinery: New York, 2017. Disponível em:
https://arxiv.org/pdf/1612.00694.pdf. Acesso em: 23 jun. 2021. (ver página 18).
JUANG, Biing Hwang; RABINER, Laurence R. Hidden Markov models for speech
recognition. Technometrics, Alexandria, v. 33, n.3, p. 251-272, aug. 1991. Disponível
em: https://www.jstor.org/stable/1268779. Acesso em: 23 jun. 2021. (ver página 18).
KIM, Joo-Kyung et al. Cross-lingual transfer learning for POS tagging without cross-
lingual resources. In: CONFERENCE ON EMPIRICAL METHODS IN NATURAL
LANGUAGE PROCESSING, 2017, Copenhagen. Proceedings [...]. Association for
Computational Linguistics (ACL): Stroudsburg, 2017. p. 2832-2838. Disponível em:
https://www.aclweb.org/anthology/D17-1.pdf. Acesso em: 24 jun. 2021. (ver página
16).
LAN, Wuwei; XU, Wei. Neural network models for paraphrase identification, semantic
textual similarity, natural language inference, and question answering. In:
INTERNATIONAL CONFERENCE ON COMPUTATIONAL LINGUISTICS, 27., 2018,
Santa Fé. Proceedings [...]. Association for Computational Linguistics: Stroudsburg,
2017. p.3890-3902. Disponível em: https://www.aclweb.org/anthology/C18-1.pdf.
Acesso em: 24 jun. 2021. (ver página 18).
LANDAUER, Thomas K.; FOLTZ, Peter W.; LAHAM, Darrell. An introduction to latent
semantic analysis. Discourse Processes, [S.l.], v. 25, n. 2-3, p. 259-284, 1998.
Disponível em: https://www.tandfonline.com/doi/abs/10.1080/01638539809545028.
Acesso em: 23 jun. 2021. (ver página 17).
LI, Chen; LIU, Yang. Joint POS tagging and text normalization for informal text. In:
INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, 24.,
2015, Buenos Aires. Proceedings [...]. AAAI Press; International Joint Conferences
LI, Fei et al. A neural joint model for entity and relation extraction from biomedical text.
BMC Bioinformatics, London, v. 18, p. 1-11, 2017. Disponível em:
https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-017-1609-9.
Acesso em: 23 jun. 2021. (ver página 16).
LOPEZ, Adam. Statistical machine translation. ACM Computing Surveys, New York,
v. 40, n. 3, p. 1-49, 2008. Disponível em:
https://dl.acm.org/doi/10.1145/1380584.1380586. Acesso em: 23 jun. 2021. (ver
página 17).
LÓPEZ, Gustavo; QUESADA, Luis; GUERRERO, Luis A. Alexa vs. Siri vs. Cortana
vs. Google Assistant: a comparison of speech-based natural user interfaces. In:
INTERNATIONAL CONFERENCE ON HUMAN FACTORS AND SYSTEMS
INTERACTION, 2017, Los Angeles. Proceedings [...]. Springer: [Berlin], 2018.
Disponível em: https://link.springer.com/chapter/10.1007/978-3-319-60366-7_23.
Acesso em: 23 jun. 2021. (ver página 18).
MILLER, George A.; HEISE, George A.; LICHTEN, William. The intelligibility of speech
as a function of the context of the test materials. Journal of Experimental
Psychology, [S.l.], v. 41, n. 5, p. 329-335, mai. 1951. Disponível em:
http://linguistics.berkeley.edu/~kjohnson/readings/Miller_Heise_Lichten_1951%20co
py.pdf. Acesso em: 23 jun. 2021. (ver página 14).
SHIEBER, Stuart M. The design of a computer language for linguistic information. In:
INTERNATIONAL CONFERENCE ON COMPUTATIONAL LINGUISTICS, 10., 1984,
Stanford. Proceedings [...]. Association for Computational Linguistics: Stroudsburg,
1984. Disponível em: https://dl.acm.org/doi/pdf/10.3115/980491.980566. Acesso em:
24 jun. 2021. (ver página 6).
Xie Chen et al. Recurrent neural network language model training with noise
contrastive estimation for speech recognition. In: IEEE INTERNACIONAL
CONFERENCE ON ACOUSTICS, SPEECH AND SIGNAL PROCESSING, 2015,
Brisbane. Proceedings [...]. IEEE: Piscataway, 2015. Disponível em:
https://ieeexplore.ieee.org/document/7179005. Acesso em: 23 jun. 2021. (ver página
18).
ZHANG, Tianyang; HUANG, Minlie; ZHAO, Li. Learning structured representation for
text classification via reinforcement learning. In: AAAI CONFERENCE ON
ARTIFICIAL INTELLIGENCE, 32., 2018, New Orleans. Proceedings [...]. AAAI Press:
Palo Alto, 2018. Disponível em: https://www.microsoft.com/en-us/research/wp-
content/uploads/2017/11/zhang.pdf. Acesso em: 24 jun. 2021. (ver página 17).
ZHIYUAN, Liu; YANKAI, Lin; MAOSONG, Sun. Representation Learning for Natural
Language Processing. Basingstoke, UK: Springer Nature, 2020 (ver página 27).