GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bayartsogt-ya/mnpolarity: Mongolian Polarity Detection in Weakly Supervised manner

BranchesTags
Open more actions menu

Latest commit

 

History

50 Commits
50 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.images
.images
 
 
configs
configs
 
 
data
data
 
 
mnpolarity
mnpolarity
 
 
output
output
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
train_simplest.py
train_simplest.py
 
 

Repository files navigation

MNPolarity - Mongolian Polarity Detection in Weakly Supervised manner

#nolabel #tweet #classification #snorkel #weaklysupervised #dataprogramming #software2.0

Tweet polarization can be useful in many analysis as an extra factor. However, because of the lack of labeled data in Mongolian (low resource language), it is hard to make progress. So in this repo, we will try to improve our classification model using data programming.

This project is highly dependant on snorkel.ai

mnpolarity-diagram.jpg

Contents:

  • Installation
  • Usage
  • Train Simplest Model
  • Structure
  • How can you improve
  • TODO
  • Reference

Installation

git clone https://github.com/bayartsogt-ya/mnpolarity.git && cd mnpolarity
python3 -m venv env && source env/bin/activate
pip install -r requirements.txt

Download latest pre-trained models

wget https://github.com/bayartsogt-ya/mnpolarity/releases/latest/download/0.0.zip -P output/
unzip output/0.0.zip -d output && rm output/0.0.zip

Usage

>>> from mnpolarity.models import SimplestModel
>>> model = SimplestModel()
>>> model.load()
>>> prediction = model.predict("эд нарыг үзэн ядаж байна")  # https://twitter.com/tsbat_IT/status/937989630472761344
>>> prediction["prettier"]
`эд нарыг үзэн ядаж байна` => NEGATIVE (0.96)
>>> prediction
{
  'pred': 1, 
  'label': 'NEGATIVE', 
  'prob': 0.9598129979059339, 
  'prettier': '`эд нарыг үзэн ядаж байна` => NEGATIVE (0.96)'
}

Train Simplest Model

python train_simplest.py

Structure

.
├── ...
├── configs
├── data
│   ├── lf_helpers
│   │   └── negative
│   │       ├── emojis.txt
│   │       ├── phrases.txt
│   │       └── words.txt
│   └── train
│       ├── twint
│       │   ├── bad_word1.csv
│       │   ├── bad_word2.csv
│       │   └── ...
│       └── twitter_dump
│           ├── dump1.csv
│           ├── dump2.csv
│           └── ...
├── mnpolarity
│   ├── labeling_functions
│   │   ├── custom_lfs.py
│   │   └── ...
│   ├── models.py
│   └── ...
└── ...

How can you improve

  • Improve Negative List
  • Add more custom labeling functions
  • Try&Feedback. If you have any request or idea to improve, please email to me

TODO

  • Negative list completion
  • Positive list creation
  • Negative list completion
  • Labeling Function addition
    • The MOST IMPORTANT part of this code is labeling functions build
  • Experiment with hand labeled data
  • Create (well validated) 1000-row test set

Reference

  • Data Programming read more
  • Software 2.0 read more

Citation

@misc{mnpolarity,
  author = {Bayartsogt Yadamsuren},
  title = {Mongolian Polarity Detection in Weakly Supervised manner},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/bayartsogt-ya/mnpolarity/}}
}

About

Mongolian Polarity Detection in Weakly Supervised manner

Topics

classificationdata-programmingmongoliannolabelpolarity-classificationpolarity-detectionpolarity-scoresnorkelsoftware2tweetunlabeled-dataweaklysupervised

Resources

Readme
Apache-2.0 license
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.