Skip to content

Commit

Permalink
e
Browse files Browse the repository at this point in the history
  • Loading branch information
ym001 committed May 17, 2020
1 parent 219a1f7 commit 9bb15e4
Show file tree
Hide file tree
Showing 20 changed files with 808 additions and 215 deletions.
11 changes: 11 additions & 0 deletions Exemples/exemple_Dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from Manteia.Dataset import Dataset

'''
ds=Dataset('20newsgroups')
##ds=Dataset('SST-2')
##ds=Dataset('SST-B')
Expand All @@ -22,3 +23,13 @@
print(ds.labels_test[:5])
print('Description : ')
print(ds.description)
'''
import exemple_Dataset1
import exemple_Dataset2
import exemple_Dataset3
import exemple_Dataset4
import exemple_Dataset5
import exemple_Dataset6
import exemple_Dataset7

12 changes: 11 additions & 1 deletion Exemples/exemple_Dataset1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
from Manteia.Dataset import Dataset

ds=Dataset('DBPedia')
ds=Dataset('DBPedia',test=True,desc=True,classe=True)

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])

print('Test : ')
print(ds.documents_test[:5])
print(ds.labels_test[:5])

print('Description :')
print(ds.description)

print('List labels :')
print(ds.list_labels)
9 changes: 9 additions & 0 deletions Exemples/exemple_Dataset10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from Manteia.Dataset import Dataset

ds=Dataset('SST-2')

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])


9 changes: 9 additions & 0 deletions Exemples/exemple_Dataset11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from Manteia.Dataset import Dataset

ds=Dataset('SST-5',dev=True)

print('Dev : ')
print(ds.documents_dev[:5])
print(ds.labels_dev[:5])


12 changes: 11 additions & 1 deletion Exemples/exemple_Dataset2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
from Manteia.Dataset import Dataset

ds=Dataset('Yahoo! Answers')
ds=Dataset('Yahoo! Answers',test=True,desc=True)

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])

print('Test : ')
print(ds.documents_test[:5])
print(ds.labels_test[:5])

print('Description :')
print(ds.description)

print('List labels :')
print(ds.list_labels)
7 changes: 7 additions & 0 deletions Exemples/exemple_Dataset5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from Manteia.Dataset import Dataset

ds=Dataset('20newsgroups')

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])
10 changes: 10 additions & 0 deletions Exemples/exemple_Dataset6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from Manteia.Dataset import Dataset

ds=Dataset('Yelp Review Polarity',test=True,desc=True)

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])
print(ds.documents_test[:5])
print(ds.labels_test[:5])
print(ds.description)
14 changes: 14 additions & 0 deletions Exemples/exemple_Dataset7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from Manteia.Dataset import Dataset

ds=Dataset('Yelp Review Full',test=True,desc=True)

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])

print('Test : ')
print(ds.documents_test[:5])
print(ds.labels_test[:5])

print('Description :')
print(ds.description)
9 changes: 9 additions & 0 deletions Exemples/exemple_Dataset8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from Manteia.Dataset import Dataset

ds=Dataset('agnews')

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])


9 changes: 9 additions & 0 deletions Exemples/exemple_Dataset9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from Manteia.Dataset import Dataset

ds=Dataset('trec')

print('Train : ')
print(ds.documents_train[:5])
print(ds.labels_train[:5])


44 changes: 5 additions & 39 deletions Exemples/exemple_Statistic.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# exemple_Data.py
#
# Copyright 2020 Yves <yves@mercadier>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#

from Manteia.Statistic import Statistic
from Manteia.Dataset import Dataset

def main(args):
documents = [
' !?? What do you call a potato in space? Spudnik:::13 ;; // ',
'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.',
'Why do you never see elephants hiding in trees? \'Cause they are freaking good at it',
'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.',
'Mom: "Do you want this?" Me: "No." Mom: "Ok I\'ll give it to your brother." Me: "No I want it."',
'Ibuprofen is my favorite headache medicine that also sounds like a reggae professor.',
'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.',
'I\'ve struggled for years to be above the influence... But I\'ve never been able to get that high',
'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',
]

labels = [
['funny'],['not funny'],['funny'],['not funny'],['funny'],['not funny'],['not funny'],['not funny'],['funny'],['not funny'],
]

Statistic(documents,labels)

ds=Dataset('pubmed_rct20k')

Statistic(ds.documents_train,ds.labels_train)

return 0

Expand Down

0 comments on commit 9bb15e4

Please sign in to comment.