-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
71 lines (67 loc) · 2.13 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
63
64
65
66
67
68
69
70
71
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import nltk
import spacy
import subprocess
import sys
import os
def readme():
current_dir = os.path.dirname(os.path.abspath(__file__))
readme_path = os.path.join(current_dir, 'readme.md')
with open(readme_path, encoding="utf8") as f:
README = f.read()
return README
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
nltk.download('vader_lexicon')
try:
spacy.load('en_core_web_sm')
except IOError:
subprocess.call([sys.executable,
"-m",
"spacy",
"download",
"en_core_web_sm"])
develop.run(self)
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
nltk.download('vader_lexicon')
try:
spacy.load('en_core_web_sm')
except IOError:
subprocess.call([sys.executable,
"-m",
"spacy",
"download",
"en_core_web_sm"])
install.run(self)
setup(
name='finemotion',
version='1.0.0',
description='Our emotional annotation algorithm is built upon the foundation ' \
'laid by the Text2Emotion project, with a series of key enhancements ' \
'aimed at optimizing its functionality for financial news analysis',
long_description=readme(),
long_description_content_type="text/markdown",
packages=find_packages(),
author="AliceNN-ucdenver",
author_email="[email protected]",
url="https://github.com/AI4Finance-Foundation/Fin-Emotion",
license="MIT",
install_requires=[
'spacy',
'nltk',
'contractions',
],
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
},
package_data={
'': ['data/*'],
},
include_package_data=True,
)