-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
reminiscent. | ||
""" | ||
|
||
__version__ = "0.0.19" | ||
__version__ = "0.0.20" | ||
|
||
|
||
from Manteia import Classification | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Loading roberta tokenizer...\n", | ||
"Loading roberta class...\n", | ||
"There are 2 GPU(s) available.\n", | ||
"We will use the GPU: GeForce RTX 2080 Ti\n", | ||
"\n", | ||
"======== Epoch 1 / 4 ========\n", | ||
"Training :\n", | ||
" \n", | ||
" Average training loss: 0.67\n", | ||
" Training epoch took: 0:00:00\n", | ||
"Validation :\n", | ||
" \n", | ||
" Accuracy: 0.00\n", | ||
" Validation took: 0:00:00\n", | ||
"\n", | ||
"======== Epoch 2 / 4 ========\n", | ||
"Training :\n", | ||
" \n", | ||
" Average training loss: 0.68\n", | ||
" Training epoch took: 0:00:00\n", | ||
"Validation :\n", | ||
" \n", | ||
" Accuracy: 0.00\n", | ||
" Validation took: 0:00:00\n", | ||
"\n", | ||
"======== Epoch 3 / 4 ========\n", | ||
"Training :\n", | ||
" \n", | ||
" Average training loss: 0.66\n", | ||
" Training epoch took: 0:00:00\n", | ||
"Validation :\n", | ||
" \n", | ||
" Accuracy: 0.00\n", | ||
" Validation took: 0:00:00\n", | ||
"\n", | ||
"======== Epoch 4 / 4 ========\n", | ||
"Training :\n", | ||
" \n", | ||
" Average training loss: 0.63\n", | ||
" Training epoch took: 0:00:00\n", | ||
"Validation :\n", | ||
" \n", | ||
" Accuracy: 0.00\n", | ||
" Validation took: 0:00:00\n", | ||
"\n", | ||
"Training complete!\n", | ||
"['not funny', 'not funny']\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from Manteia.Classification import Classification \n", | ||
"from Manteia.Model import Model \n", | ||
"\n", | ||
"import warnings\n", | ||
"warnings.filterwarnings(\"ignore\")\n", | ||
"\n", | ||
"documents = [\n", | ||
"\t\t\t' !?? What do you call a potato in space? Spudnik:::13 ;; // ',\n", | ||
"\t\t\t'What should you do before criticizing Pac-Man? WAKA WAKA WAKA mile in his shoe.',\n", | ||
"\t\t\t'What did Arnold Schwarzenegger say at the abortion clinic? Hasta last vista, baby.',\n", | ||
"\t\t\t'Why do you never see elephants hiding in trees? \\'Cause they are freaking good at it',\n", | ||
"\t\t\t'My son just got a tattoo of a heart, a spade, a club, and a diamond, all without my permission. I guess I\\'ll deal with him later.',\n", | ||
"\t\t\t'Mom: \"Do you want this?\" Me: \"No.\" Mom: \"Ok I\\'ll give it to your brother.\" Me: \"No I want it.\"',\n", | ||
"\t\t\t'Ibuprofen is my favorite headache medicine that also sounds like a reggae professor.',\n", | ||
"\t\t\t'INTERVIEWER: Why do you want to work here? ME: *crumbs tumbling from my mouth* Oh, I don\\'t. I was just walking by and saw you had donuts.',\n", | ||
"\t\t\t'I\\'ve struggled for years to be above the influence... But I\\'ve never been able to get that high',\n", | ||
"\t\t\t'With Facebook, you can stay in touch with people you would otherwise never talk to, but that\\'s only one of the many awful things about it',\n", | ||
"\t\t\t]\n", | ||
"\t\t\t\n", | ||
"labels = [\n", | ||
"\t\t\t'funny','not funny','funny','not funny','funny','not funny','not funny','not funny','funny','not funny'\n", | ||
"\t\t\t]\n", | ||
"\t\t\t\n", | ||
"model = Model(model_name ='roberta')\n", | ||
"cl=Classification(model,documents,labels,process_classif=True)\n", | ||
"print(cl.predict(documents[:2]))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "tf_gpu", | ||
"language": "python", | ||
"name": "tf_gpu" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |