Simple Keras model for classifying Dhivehi news topics based on article content. Inpired by this article published on becominghuman.ai. Live demo available here.
- Create a virtual environment with
python3.8(recommended) git clone https://github.com/ashraq1455/DhivehiNewsClassifier.gitpip install -r requirements.txt- Run
gdown --id 1aYSqY7jY7MAK_j1t0hRTf6R7QjvO_u1Ito download the dataset (18.5 MB) - Extract and move
dataset.csvtodatadirectory
| category | title_body |
|---|---|
| politics | ރައީސް ޔާމީންގެ މެސެޖެއް: އަލުން ޕީޕީއެމްއަށް ރާއްޖޭގެ އިގްތިސާދު ސަލާމަތް ކުރެވޭނެ!. އަނެއްކާވެސް އަލުން ޕީޕީއެމްއަށް ރާއްޖޭގެ އިގްތިސާދު ސަލާމަތްކޮށް، ޝަރުއީ އަދި ގާނޫނީ ދާއިރާ އަށް މާނަވީ އިސްލާހްތައް ގެނެވޭނެ ކަމަށް ކުރީގެ ރައީސް، އަދި އިދިކޮޅު ކޯލިޝަންގެ ލީޑަރު އަބްދުﷲ ޔާމީން އަބްދުލް ގައްޔޫމް ވިދާޅުވެއްޖެއެވެ |
| sport | މެސީގެ ހާއްސަ ޓްރިބިއުޓެއް މަރަޑޯނާއަށް. ދާދިފަހުން މަރުވި އާޖެންޓީނާގެ ލެޖެންޑް ޑިއެގޯ މަރަޑޯނާގެ ހަނދާނުގައި ބާސާއަށް ކުޅެމުން އަންނަ ތަރި ލިއޮނަލް މެސީ ހާއްސަ ޓްރިބިއުޓެއް ދީފިއެވެ. ސްޕެނިޝް ލީގުގައި އޮސަސޫނާ އަތުން 4-0 އިން ބާސެލޯނާ މޮޅުވި މި މެޗުގައި މެސީ ޓްރިބިއުޓް އެއް ދީފައިވަނީ އޭނާ މެޗުގެ ހަތަރުވަނަ ގޯލު ޖެހުމަށްފަހު އެވެ |
- After setup run
python train.py.
- To load the most recently trained model run
python inference.py - To load the model with best accuracy run
python inference.py --best - To load a specific model run
python inference.py --modeland select a model
To search best hyperparameters for your dataset, specify ranges for output_dim, hp_learning_rate, input_unit and run python search_best_hparams.py.
| name | file_id | tra_accuracy | val_accuracy | size |
|---|---|---|---|---|
| mvnews_classifier_1622907065.zip | 11Bm_h9PXKYyWlv3Rw_2vHMcNES0Zl1CT | 99.75% | 95.74% | 87.5 MB |
- To download pre-trained models run
gdown --id <file_id> - Extract the file and move all content to
modelsdirectory - To run inference on the model run
python inference.py
This model is trained using 33068 articles scrapped from vaguthu.mv. It can currently predict 5 categories: Politics, Business, Sports, World-News, Report
- PhoenixAtom - Live demo website