Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
besbes-ahmed committed Feb 26, 2021
1 parent 0777f70 commit 01a1ac4
Show file tree
Hide file tree
Showing 8 changed files with 626 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.ipynb_checkpoints


__pycache__/
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# multi-label-sentiment-classifier
How to build a multi-label sentiment classifiers with Tez and PyTorch
### Training a Multi-Label Emotion Classifier with Tez and PyTorch

If you're tired of rewriting the same boilerplate code of your training pipelines in PyTorch, I've found a pretty neat solution that could make your life easier. Don't worry, it's not a heavy library that'll change your way of doing things.

It's rather a lightweight wrapper that encapsulates your training logic in a single class. It's built on top of PyTorch, it's quite recent but I've tested it and I think it does what it promises so far.

It's called Tez and we'll see it today in action on a fun multi-label text classification problem. Let's jump right in.

![](./images/goemotions.png)
Empty file added export/.gitkeep
Empty file.
Binary file added images/goemotions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
_CLASS_NAMES = [
"admiration",
"amusement",
"anger",
"annoyance",
"approval",
"caring",
"confusion",
"curiosity",
"desire",
"disappointment",
"disapproval",
"disgust",
"embarrassment",
"excitement",
"fear",
"gratitude",
"grief",
"joy",
"love",
"nervousness",
"optimism",
"pride",
"realization",
"relief",
"remorse",
"sadness",
"surprise",
"neutral",
]

mapping = dict(zip(range(len(_CLASS_NAMES)),_CLASS_NAMES))
Empty file added logs/.gitkeep
Empty file.
Loading

0 comments on commit 01a1ac4

Please sign in to comment.