示例#1
0
                    default='data/corpus.csv',
                    type=str)
parser.add_argument('-t', '--tweets_path',
                    help='tweets path',
                    default='data/rawdata/',
                    type=str)
parser.add_argument('-f', '--dest_file',
                    help='File where is stored the model',
                    default='classifier',
                    type=str)
args = parser.parse_args()


# Process the training of the model
print "Initialization"
s = SetManager(args.csv_path, args.tweets_path)
tokenizer = Tokenizer(preserve_case=False)
cm = ClassifierManager()

# List of the sentiments used (feature space)
sentiments = ['Virtue', 'Weak', 'HU', 'Hostile', 'EnlTot', 'ComForm',
              'Passive', 'Pstv', 'Ngtv', 'PowTot', 'Strong', 'Positiv',
              'IAV', 'Active', 'Negativ']
sentiments.reverse()
classifiers = {}

print "DB connexion"
con = None

try:
    db, usr, pwd = load_database('database.properties')