Code Monkey home page Code Monkey logo

swahili-news-classifier-api's Introduction

Swahili News Classifier API

An API developed by using the FastAPI library and uses an NLP model to classify the category of the news in the Swahili language.

API URL: https://limitless-forest-00896.herokuapp.com/news-prediction/

News Categories

The NLP model will classify news by using the following categories.

  1. Kitaifa (National)
  2. Michezo (Sports)
  3. Biashara (Economy)
  4. Kimataifa (International)
  5. Burudani (Entertainment)

Example

How to use the API URL in your own application.The example below uses python programming language.

import requests as r

# sample news article
news = "Mshambuliaji wa Chelsea Romelu Lukaku amehusishwa na kurejea katika klabu yake ya zamani Inter Milan lakini mchezaji huyo wa kimataifa wa Ubelgiji mwenye umri wa miaka 28 anataka kusalia na kupigania nafasi yake Stamford Bridge. (Mirror)"

# make prediction
keys = {"news": news}
prediction = r.get(
    "https://limitless-forest-00896.herokuapp.com/news-prediction/", params=keys
)

# collect and print the result
results = prediction.json()
print(results["prediction"])
print(results["Probability"])

Note: You can use the API URL in any programming language, you just need to follow the instruction of a particular langauge to access and use this API.

Issues

Incase you have any difficulties or issues while trying to run the script you can raise it on the issues section.

Pull Requests

If you have something to add or new idea to implement, you are welcome to create a pull requests on improvement.

Give it a Star

If you find this repo useful , give it a star so as many people can get to know it.

Credits

All the credits to Davis David

swahili-news-classifier-api's People

Contributors

davisy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

misingo255

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.