Natural Language
Processing
-NLP and Python-
Dr. Fatma Ben Mesmia
[email protected]
NLP and Python
> Natural Language Toolkit (NLTK)
> Gensim
> SpaCy
> CoreNLP
> TextBlob
> AllenNLP
> Polyglot
> Scikit-Learn
2
Python conditionals, functions
• Python functions provide an efficient and Example:
organized approach to developing natural
def greet(name):
language understanding applications return f"Hello,
{name}!"
• functions enhance code structure, user_name = "Alice"
message = greet(user_name)
readability, and maintainability print(message)
• With Python’s versatile ecosystem, the
potential for NLP innovation is boundless
3
NLP tasks
• NLP tasks in syntax, semantics, and pragmatics
>> See Introduction slides
4
Role of Machine Learning
Machine learning for NLP helps data analysts
turn unstructured text into usable data and
insights
5
Ambiguity and uncertainty in language
• Ambiguity and uncertainty in language
>> See Introduction slides
6
NLTK library
Some common applications of the NLTK
Text preprocessing
NER
recognition
7
Limitations of NLP
• NLP limitations: Bias in language/data, e.g.,
gender/racial bias in training
• Dependency on large data: Challenging to
obtain, may cause inaccuracies
• Human input needed: Correct errors,
especially with rare cases not well-
represented in data
8
Thank You!
Big Data and Data Analytics 9