-
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
27 changed files
with
643 additions
and
136 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from Manteia.Classification import Classification | ||
from Manteia.Model import Model | ||
|
||
documents = ['What should you do before criticizing Pac-Man? WAKA WAKA WAKA mile in his shoe.','What did Arnold Schwarzenegger say at the abortion clinic? Hasta last vista, baby.',] | ||
|
||
labels = ['funny','not funny'] | ||
|
||
model = Model(model_name ='roberta') | ||
cl=Classification(model,documents,labels,process_classif=True) |
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,13 @@ | ||
from Manteia.Classification import Classification | ||
from Manteia.Preprocess import list_labels | ||
from Manteia.Model import Model | ||
|
||
documents = ['What should you do before criticizing Pac-Man? WAKA WAKA WAKA mile in his shoe.','What did Arnold Schwarzenegger say at the abortion clinic? Hasta last vista, baby.',] | ||
|
||
labels = ['funny','not funny'] | ||
|
||
model = Model(model_name ='roberta') | ||
cl=Classification(model,documents,labels) | ||
cl.list_labels = list_labels(labels) | ||
cl.process() | ||
print(cl.predict(documents[:2])) |
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,12 @@ | ||
from Manteia.Classification import Classification | ||
from Manteia.Preprocess import list_labels | ||
|
||
documents = ['What should you do before criticizing Pac-Man? WAKA WAKA WAKA mile in his shoe.','What did Arnold Schwarzenegger say at the abortion clinic? Hasta last vista, baby.',] | ||
|
||
labels = ['funny','not funny'] | ||
|
||
cl=Classification(documents_train = documents,labels_train = labels) | ||
cl.list_labels = list_labels(labels) | ||
cl.load_model() | ||
cl.model.devices() | ||
print(cl.predict(documents[:2])) |
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,13 @@ | ||
from Manteia.Classification import Classification | ||
from Manteia.Preprocess import list_labels | ||
|
||
documents = ['What should you do before criticizing Pac-Man? WAKA WAKA WAKA mile in his shoe.','What did Arnold Schwarzenegger say at the abortion clinic? Hasta last vista, baby.',] | ||
|
||
labels = ['funny','not funny'] | ||
|
||
cl=Classification(documents_train = documents,labels_train = labels) | ||
cl.list_labels = list_labels(labels) | ||
cl.load_model() | ||
dt_train ,dt_validation=cl.process_text() | ||
cl.model.configuration(dt_train) | ||
cl.model.fit(dt_train,dt_validation) |
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,11 @@ | ||
from Manteia.Classification import Classification | ||
from Manteia.Model import Model | ||
|
||
documents = ['What should you do before criticizing Pac-Man? WAKA WAKA WAKA mile in his shoe.' | ||
,'What did Arnold Schwarzenegger say at the abortion clinic? Hasta last vista, baby.',] | ||
|
||
labels = ['funny','not funny'] | ||
|
||
model = Model(model_name ='roberta') | ||
cl=Classification(model,documents,labels,process_classif=True) | ||
print(cl.predict(documents[:2])) |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from Manteia.Dataset import Dataset | ||
|
||
ds=Dataset('DBPedia') | ||
|
||
print('Train : ') | ||
print(ds.documents_train[:5]) | ||
print(ds.labels_train[:5]) |
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,7 @@ | ||
from Manteia.Dataset import Dataset | ||
|
||
ds=Dataset('Yahoo! Answers') | ||
|
||
print('Test : ') | ||
print(ds.documents_test[:5]) | ||
print(ds.labels_test[:5]) |
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,8 @@ | ||
from Manteia.Dataset import Dataset | ||
|
||
ds=Dataset('pubmed_rct20k') | ||
|
||
print('Train : ') | ||
print(ds.documents_train[:5]) | ||
print(ds.labels_train[:5]) | ||
|
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,7 @@ | ||
from Manteia.Dataset import Dataset | ||
|
||
ds=Dataset('drugscom') | ||
|
||
print('Train : ') | ||
print(ds.documents_train[:5]) | ||
print(ds.labels_train[:5]) |
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
Oops, something went wrong.