Skip to main content

This python library provides corpus in English and various local african languages e.g(Youruba, Hausa, Pidgin), it also does sentiment analysis on brands

Project description

This python library provides corpus in English and various local african languages e.g(Youruba, Hausa, Pidgin), it also does sentiment analysis on brands

USAGE

Brand Sentiment Analysis

brand = the name of the brand you will like to perfrom sentiment analysis on e.g "MTN" csvFileName = The name of the csv file you will like to save your output to, default is brandNews.csv. (optional parameter)
from anjie import brandSentimentAnalysis
brandSentimentAnalysis.anjie_brands(brand = "MTN", csvFileName = 'brandNews')
import pandas as pd
df = pd.read_csv("brandNews.csv.csv")

Scraping English Corpus

noRows = The number of rows of news you want. csvFileName = The name of the csv file you will like to save your output to, default is news.csv. (optional parameter) News categories include ['news', 'sports', 'metro-plus', 'politics', 'business', 'entertainment', 'editorial', 'columnist'] removeCategories = [] :as a parameter for news categories you dont want in the scraped corpus. (optional parameter) e.g , englishCorpus.scrape(noRows = 150, removeCategories = ['metro-plus', 'politics'])

pass onlyCategories = [] : as a parameter for only categories you want in the scraped corpus. (optional parameter) e.g , englishCorpus.scrape(noRows = 150, onlyCategories = ['news', 'sports', 'metro-plus', 'entertainment', 'editorial', 'columnist'])


from anjie import englishCorpus
englishCorpus.scrape(noRows = 150)
df = pd.read_csv("news.csv")

Scraping Hausa Corpus
noRows = The number of rows of news you want. only 60 rows of hausa corpus is currently available. csvName = The name of the csv file you will like to save your output to, default is hausa_news.csv. (optional parameter)


from anjie import hausaCorpus
hausaCorpus.scrape(noRows = 10)
import pandas as pd
df = pd.read_csv("hausa_news.csv")

Scraping Pidgin English corpus
noRows = The number of rows of news you want. csvFileName = The name of the csv file you will like to save your output to, default is pidgin_corpus.csv. (optional parameter) News categories include ['nigeria', 'africa', 'sport', 'entertainment'] removeCategories = [] :as a parameter for news categories you dont want in the scraped corpus. (optional parameter) e.g , englishCorpus.scrape(noRows = 150, removeCategories = ['entertainment'])

pass onlyCategories = [] : as a parameter for only categories you want in the scraped corpus. (optional parameter) e.g , englishCorpus.scrape(noRows = 150, onlyCategories = ['nigeria','sport', 'entertainment'])
from anjie import pidginCorpus
pidginCorpus.scrape(noRows = 20)
df = pd.read_csv("pidgin_corpus.csv")

Scraping Yoruba Corpus
noRows = The number of rows of news you want. csvFileName = The name of the csv file you will like to save your output to, default is yoruba_corpus.csv. (optional parameter)


from anjie import yorubaCorpus
yorubaCorpus.scrape(noRows = 20)
df = pd.read_csv("yoruba_corpus.csv")

Github link for project - https://github.com/Free-tek/Anjie_local_language_corpus_generator

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for anjie, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size anjie-1.0.0-py3-none-any.whl (2.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size anjie-1.0.0.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page