Saturday , December 21 2024

Natural Language Processing

Speech to Text and Text to Speech

Speech to Text and Text to Speech Python Text to Speech¶ In [ ]: pip install pyttsx3 In [1]: import pyttsx3 engine = pyttsx3.init() engine.say("I will speak this text") engine.runAndWait() In [2]: import pyttsx3 engine = pyttsx3.init() text = "pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and …

Read More »

Text to Speech

Text to Speech Python Text to Speech (Pyttsx3)¶ https://pypi.org/project/pyttsx3/ In [ ]: pip install pyttsx3 In [2]: import pyttsx3 In [3]: engine = pyttsx3.init() engine.say("I will speak this text") engine.runAndWait() In [4]: engine = pyttsx3.init() engine.say("pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python …

Read More »

NLP Tokenizer

1. NLP Tokenizer NLP Examples¶Today, Natual process learning technology is widely used technology. Here, are common Application’ of NLP: Information retrieval & Web Search Google, Yahoo, Bing, and other search engines base their machine translation technology on NLP deep learning models. It allows algorithms to read text on a webpage, …

Read More »

Stop Words

2 Stop Words In [3]: from nltk.tokenize import word_tokenize, sent_tokenize sample_sentence="Hi I am Learning NLP with Itronix Solutions" a=word_tokenize(sample_sentence) print(a) ['Hi', 'I', 'am', 'Learning', 'NLP', 'with', 'Itronix', 'Solutions'] In [4]: from nltk.corpus import stopwords stop_words=set(stopwords.words("english")) print(stop_words) for word in a: if word not in stop_words: print(word,end=" ") {'she', 'into', 'were', 'more', 'with', …

Read More »

Corpus Wordnet

3 Corpus Wordnet Synsets, Hypernyms and Hyponyms¶WordNet is the lexical database i.e. dictionary for the English language, specifically designed for natural language processing. Synset is a special kind of a simple interface that is present in NLTK to look up words in WordNet. Synset instances are the groupings of synonymous …

Read More »

Lemmatization

6 Lemmatization Lemmatization is the process of grouping together the different inflected forms of a word so they can be analysed as a single item. Lemmatization is similar to stemming but it brings context to the words. So it links words with similar meaning to one word. In [3]: from nltk.stem …

Read More »

Stemming

4 Stemming A stemming algorithm reduces the words “chocolates”, “chocolatey”, “choco” to the root word, “chocolate” and “retrieval”, “retrieved”, “retrieves” reduce to the stem “retrieve”.¶Applications of stemming are:¶ Stemming is used in information retrieval systems like search engines. It is used to determine domain vocabularies in domain analysis. In [1]: from …

Read More »

Accuracy Score

Accuracy Score Accuracy Score is a metric used to evaluate the performance of a classification model. It measures the percentage of correct predictions made by the model out of all predictions. In other words, it tells you how often the model correctly classifies data points. The formula for accuracy is: …

Read More »

List of NLP Projects

List of NLP – Projects Here’s a curated list of NLP (Natural Language Processing) projects you can build using Python, along with brief descriptions and potential libraries or tools to use. Beginner Projects¶ Sentiment Analysis Description: Analyze the sentiment of text data (positive, negative, neutral). Libraries/Tools: TextBlob, NLTK, VADER Example: …

Read More »

NLP – Practically

mail data – NLP In [1]: import pandas as pd import numpy as np In [2]: data = pd.read_csv('mail_data.csv') data Out[2]: Category Message 0 ham Go until jurong point, crazy.. Available only … 1 ham Ok lar… Joking wif u oni… 2 spam Free entry in 2 a wkly comp to win …

Read More »