Text-Blob-Classifier

Sat 17 May 2025

title: "Text Blob Classifier" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


from textblob.classifiers import NaiveBayesClassifier
train = [
     ('I love this sandwich.', 'pos'),
     ('this is an amazing place!', 'pos'),
     ('I feel very good about these beers.', 'pos'),
     ('this is my best work.', 'pos'),
     ("what an awesome view", 'pos'),
     ('I …

Category: textprocessing

Read More

Text-Classification-Nb

Sat 17 May 2025

title: "Text Classification - Naive Bayes - Stackoverflow Tags" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


# Disclaimer: some code copied form this https://towardsdatascience.com/multi-class-text-classification-model-comparison-and-selection-5eb066197568
import logging
import pandas as pd
import numpy as np
from numpy import random
import gensim
import nltk
from sklearn.model_selection import train_test_split
from …

Category: textprocessing

Read More

Text-File-2-Nltk-Text

Sat 17 May 2025

title: "Text File 2 NLTK Text" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import nltk
f =open('canola.txt','r')
raw = f.read()
raw
'OTTAWA—The federal Liberals promised Wednesday to give Canada’s canola farmers much-needed financial aid to help lessen the impact of China’s decision …

Category: textprocessing

Read More

Text-Index-And-Slicing

Sat 17 May 2025

title: "Text Index and Slicing" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import nltk
f =open('canola.txt','r')
raw = f.read()
raw
'OTTAWA—The federal Liberals promised Wednesday to give Canada’s canola farmers much-needed financial aid to help lessen the impact of China’s decision to …

Category: textprocessing

Read More

Text-To-Vector

Sat 17 May 2025

title: "Text to Vector" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import nltk
content = "The Democrats — including more than 50 freshmen — are mindful that impeachment poses political risks that could endanger the seats of moderates and their majority, as well as strengthen Mr. Trump’s hand. "
content
'The …

Category: textprocessing

Read More

Textblob-Classifier-2

Sat 17 May 2025

title: "TextBlob Classifier 2" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


from textblob.classifiers import NaiveBayesClassifier
from textblob import TextBlob
train = [
     ('I love this sandwich.', 'pos'),
     ('this is an amazing place!', 'pos'),
     ('I feel very good about these beers.', 'pos'),
     ('this is my best work.', 'pos'),
     ("what an …

Category: textprocessing

Read More

Wav-2-Txt

Sat 17 May 2025

title: "Wav 2 Text" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import speech_recognition as sr
from os import path
from pydub import AudioSegment
'''
How to install ffmpeg:
brew tap varenc/ffmpeg
brew tap-pin varenc/ffmpeg
brew install ffmpeg $(brew options ffmpeg --compact)
    https://gist.github.com/clayton/6196167 …

Category: textprocessing

Read More

Wiki-Bag-Of-Words

Sat 17 May 2025

title: "Wiki Bag of Words" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import re
from nltk.tokenize import word_tokenize
from collections import Counter
article = """'\'\'\'Debugging\'\'\' is the process of finding and resolving of defects that prevent correct operation of computer software or a system.  \n\nNumerous books …

Category: textprocessing

Read More

Wiki-Bag-Of-Words-2

Sat 17 May 2025

title: "Wiki Bag of Words 2" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import re
from nltk.tokenize import word_tokenize
from collections import Counter
article = """Natural lead consists of four stable isotopes with mass numbers of 204, 206, 207, and 208,[27] and traces of five short-lived radioisotopes …

Category: textprocessing

Read More

Word-Average

Sat 17 May 2025

title: "Word Average" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import nltk
f =open('canola.txt','r')
raw = f.read()
raw
'OTTAWA—The federal Liberals promised Wednesday to give Canada’s canola farmers much-needed financial aid to help lessen the impact of China’s decision to ban the …

Category: textprocessing

Read More
Page 4 of 5

« Prev Next »