klassify
Text classification with Redis
Fatih Erikli
Software Developer
@Adphorus
fatiherikli@gmail.com
http://fatiherikli.com
Text Classification
The task is to assign a document to one or
more classes or categories.
• Spam filters
• Web page classification
• News and and topic categorization
• Sentiment Analysis
Use cases
• Neural Networks
• K-nearest neighbour algorithms
• Decision Trees
• Naive Bayes Classification
Techniques
Training
Just count the words under a label.
Politics
democrat 4
socialism 20
democrat 30
communism 20
politician 10
holacaust 20
Drugs
smoke 30
weed 22
lsd 34
heroin 54
cannabis 23
marijuana 52
Classification
Stem, singularize and eliminate given text
Marijuana should be legalized
nationally in the United States
just as it is already in
Colorado.
Classification
Calculate scores for each labels
Marijuana should be legalized
nationally in the United States
just as it is already in
Colorado.
drugs: 4 drugs: 2
politics: 3
Drugs = 4 + 2 = 6 / TotalWordCountOfDrugs
Politics = 3 / TotalWordCountOfPolitics
Redis Implementation
SADD labels Politics
SADD labels Drugs
SADD labels Game
SADD labels Programming
Initial labels
initial labels on a Set which is called `labels`
HINCRBY Programming Brainfuck 2
`awesome` and `is` should not be
trained. they are fuzzy words for
training logic.
Querying for training
“Brainfuck! Brainfuck is awesome” as Programming
HVALS Programming
# 3 3 2 3 5


HGET Programming Brainfuck
# 5
Queries for classification
A protoype:
http://github.com/fatiherikli/klassify


HTTP POST :8888/train


{
‘text’: ‘Brainfuck is awesome’,

‘label’: ‘Programming’
}
Training




HTTP POST :8888/classify


{
‘text’: ‘Brainfuck is awesome’
}
Classification


{
"label": "Programming",
"scores": {
"Aliens": 1.428,
"Animals": 2.380,
"Society": 6.4935,
"Technology": 9.523
}
}
responserequest


{
"label": "Programming",
"scores": {
"Aliens": 1.4285714285714287e-05,
"Animals": 2.380952380952381e-06,
"Society": 6.493506493506494e-07,
"Technology": 9.523809523809525e-07
}
}
Response
DEMO

More Related Content

PDF
Agent-based Models
PDF
Celery
PDF
PDF
Django Introduction
PDF
Arguman
PDF
Django ORM Optimizasyonu
PDF
Lettuce ile Behaviour Driven Development
PDF
Processing - Programcılar için eskiz defteri
Agent-based Models
Celery
Django Introduction
Arguman
Django ORM Optimizasyonu
Lettuce ile Behaviour Driven Development
Processing - Programcılar için eskiz defteri

Recently uploaded (20)

PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PPTX
How to use fields_get method in Odoo 18
PPTX
Information-Technology-in-Human-Society.pptx
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
Altius execution marketplace concept.pdf
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
substrate PowerPoint Presentation basic one
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Launch a Bumble-Style App with AI Features in 2025.pdf
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
How to use fields_get method in Odoo 18
Information-Technology-in-Human-Society.pptx
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
How to Convert Tickets Into Sales Opportunity in Odoo 18
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
Altius execution marketplace concept.pdf
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
substrate PowerPoint Presentation basic one
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Launch a Bumble-Style App with AI Features in 2025.pdf
Connector Corner: Transform Unstructured Documents with Agentic Automation
Report in SIP_Distance_Learning_Technology_Impact.pptx
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Ad
Ad

Klassify: Text Classification with Redis