-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
63 lines (53 loc) · 1.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: djokester
Samriddhi Sinha,
IIT Kharagpur
"""
import sys
import subprocess
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print('To install, run \'python setup.py install\'')
print()
if sys.version_info[:2] < (3, 5):
print(('lingatagger requires Python version 3.5 or later (%d.%d detected).' %sys.version_info[:2]))
sys.exit(-1)
try:
import tensorflow
except ImportError:
try:
subprocess.call(['pip', 'install', "tensorflow"])
import tensorflow
except ImportError:
print('tensorflow must be installed to use lingatagger')
sys.exit(-1)
try:
import re
except ImportError:
print('re must be installed to use lingatagger')
sys.exit(-1)
try:
import keras
except ImportError:
try:
subprocess.call(['pip', 'install', "keras"])
import tensorflow
except ImportError:
print('keras must be installed to use lingatagger')
sys.exit(-1)
sys.path.insert(0, 'lingatagger')
if __name__ == "__main__":
setup(
name = "lingatagger",
version = "1.0",
author = "Samriddhi Sinha",
author_email = "[email protected]",
description = "A simple gender tagger for Hindi based on an Multi Layer Perceptron Classifier trained with gensim's word2vec. It is backed off by Regex and Lookup Tagger",
url='https://github.com/djokester/lingatagger',
keywords= ['nlp', 'hindi', 'linguistics'],
packages = ['lingatagger'],
license = 'Apache License',
install_requires = ['gensim', 'regex', 'sklearn']
)