reflexive 1.2.1__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {reflexive-1.2.1 → reflexive-1.2.2}/PKG-INFO +1 -1
- {reflexive-1.2.1 → reflexive-1.2.2}/pyproject.toml +1 -1
- reflexive-1.2.2/src/reflexive/__init__.py +15 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/src/reflexive/analyse.py +1 -2
- {reflexive-1.2.1 → reflexive-1.2.2}/src/reflexive/cfg.py +2 -4
- {reflexive-1.2.1 → reflexive-1.2.2}/src/reflexive/session.py +1 -2
- {reflexive-1.2.1 → reflexive-1.2.2}/src/reflexive/util.py +9 -7
- {reflexive-1.2.1 → reflexive-1.2.2}/src/reflexive/visualise.py +20 -1
- reflexive-1.2.1/src/reflexive/__init__.py +0 -5
- {reflexive-1.2.1 → reflexive-1.2.2}/.gitignore +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/LICENSE +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/README.md +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.13-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.13.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.14-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.14.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.15-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.15.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.16-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.16.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.17-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.17.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.18-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.18.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.19-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.19.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.20-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.0.20.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.1.0-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.1.0.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.1.1-py3-none-any.whl +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/old reflexive dist/reflexive-1.1.1.tar.gz +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/pixi.lock +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/tests/__init__.py +0 -0
- {reflexive-1.2.1 → reflexive-1.2.2}/tests/test_reflexive.py +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Make classes available at top level
|
|
2
|
+
|
|
3
|
+
from reflexive.cfg import Config
|
|
4
|
+
from reflexive.session import (
|
|
5
|
+
AWS,
|
|
6
|
+
S3,
|
|
7
|
+
Comprehend)
|
|
8
|
+
|
|
9
|
+
# import reflexive.util
|
|
10
|
+
from reflexive.analyse import Nlp
|
|
11
|
+
from reflexive.visualise import (
|
|
12
|
+
Display,
|
|
13
|
+
RES_graph)
|
|
14
|
+
|
|
15
|
+
__all__ = ["Config","AWS","S3","Comprehend","Nlp","Display","RES_graph"]
|
|
@@ -6,7 +6,6 @@ import re
|
|
|
6
6
|
from reflexive import util
|
|
7
7
|
from reflexive import cfg
|
|
8
8
|
from reflexive import session
|
|
9
|
-
import reflexive as rfx
|
|
10
9
|
|
|
11
10
|
import logging
|
|
12
11
|
logging.basicConfig(level=logging.DEBUG)
|
|
@@ -290,7 +289,7 @@ class Nlp:
|
|
|
290
289
|
for grp in targetedSentiment_results:
|
|
291
290
|
for mention in grp["Mentions"]:
|
|
292
291
|
if mention['Score'] >= threshold:
|
|
293
|
-
if
|
|
292
|
+
if "NEUTRAL" not in mention['MentionSentiment']['Sentiment']:
|
|
294
293
|
k = mention['MentionSentiment']['Sentiment']
|
|
295
294
|
text = str.lower(mention['Text'])
|
|
296
295
|
sents.setdefault(k,{text}).add(text)
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
import json
|
|
5
|
-
import reflexive as rfx
|
|
6
4
|
|
|
7
|
-
logging.basicConfig(level=logging.DEBUG)
|
|
5
|
+
#logging.basicConfig(level=logging.DEBUG)
|
|
8
6
|
logger = logging.getLogger(__name__)
|
|
9
7
|
|
|
10
8
|
class Config:
|
|
@@ -74,7 +72,7 @@ class Config:
|
|
|
74
72
|
if not os.path.exists(data_dir):
|
|
75
73
|
logger.warning("Path does not exist, creating directory")
|
|
76
74
|
os.makedirs(data_dir)
|
|
77
|
-
logger.info(
|
|
75
|
+
logger.info("Created %s",repr(data_dir))
|
|
78
76
|
self.local_path = local_path
|
|
79
77
|
if not date_string:
|
|
80
78
|
date_string = datetime.today().strftime('%Y%m%d')
|
|
@@ -5,7 +5,6 @@ import tarfile
|
|
|
5
5
|
import json
|
|
6
6
|
|
|
7
7
|
from reflexive import cfg
|
|
8
|
-
import reflexive as rfx
|
|
9
8
|
|
|
10
9
|
import logging
|
|
11
10
|
logging.basicConfig(level=logging.DEBUG)
|
|
@@ -19,7 +18,7 @@ class AWS:
|
|
|
19
18
|
def __init__(self,config:cfg.Config):
|
|
20
19
|
# on initialisation create a new session with provided profile (or with default profile)
|
|
21
20
|
#logger.error(config.get_parameters())
|
|
22
|
-
if config
|
|
21
|
+
if config is None:
|
|
23
22
|
config = cfg.Config()
|
|
24
23
|
self.config = config
|
|
25
24
|
self.new_session()
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import os
|
|
2
|
-
|
|
2
|
+
import json
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from sklearn.preprocessing import MinMaxScaler
|
|
3
5
|
import logging
|
|
4
6
|
logging.basicConfig(level=logging.DEBUG)
|
|
5
7
|
logger = logging.getLogger(__name__)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
# File functions
|
|
10
12
|
def get_data_path_name(config,name,ext):
|
|
@@ -20,7 +22,7 @@ def set_sub_dir(config,sub_dir=None):
|
|
|
20
22
|
logger.info(f"Creating subdirectory: {local_dir}")
|
|
21
23
|
os.makedirs(local_dir)
|
|
22
24
|
else:
|
|
23
|
-
local_dir = local_path
|
|
25
|
+
local_dir = config.local_path
|
|
24
26
|
return local_dir
|
|
25
27
|
|
|
26
28
|
|
|
@@ -46,12 +48,12 @@ def filter_dict_by_value(ngrams,min_val=3):
|
|
|
46
48
|
|
|
47
49
|
# Input a series and output a list of lists with each maxn elements
|
|
48
50
|
def series_to_chunked_list(series,maxn=25):
|
|
49
|
-
|
|
50
|
-
return __chunk_list(
|
|
51
|
+
lst = list(series)
|
|
52
|
+
return __chunk_list(lst,maxn)
|
|
51
53
|
|
|
52
54
|
# Chunk a list into a list of lists with maxn elements
|
|
53
|
-
def __chunk_list(
|
|
54
|
-
return [
|
|
55
|
+
def __chunk_list(lst,maxn=25):
|
|
56
|
+
return [lst[i:i + maxn] for i in range(0, len(lst), maxn)]
|
|
55
57
|
|
|
56
58
|
# Count named entities
|
|
57
59
|
def count_entities(entities):
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
from graph_tool.all import
|
|
1
|
+
from graph_tool.all import (
|
|
2
|
+
Graph,
|
|
3
|
+
graph_draw,
|
|
4
|
+
ungroup_vector_property,
|
|
5
|
+
group_vector_property
|
|
6
|
+
)
|
|
2
7
|
import cairo
|
|
3
8
|
|
|
9
|
+
from spacy import displacy
|
|
10
|
+
|
|
4
11
|
from reflexive import session
|
|
5
12
|
from reflexive import cfg
|
|
6
13
|
|
|
@@ -188,6 +195,18 @@ class Display:
|
|
|
188
195
|
#print("New offsets:",len(new_offsets[k]))
|
|
189
196
|
return new_offsets
|
|
190
197
|
|
|
198
|
+
class RES_text:
|
|
199
|
+
|
|
200
|
+
def __init__(self):
|
|
201
|
+
self._setup()
|
|
202
|
+
|
|
203
|
+
def _setup(self):
|
|
204
|
+
return None
|
|
205
|
+
|
|
206
|
+
def show(self):
|
|
207
|
+
#displacy.render(disp_data,manual=True,style="ent", options=cfg.display_options)
|
|
208
|
+
return None
|
|
209
|
+
|
|
191
210
|
class RES_graph:
|
|
192
211
|
|
|
193
212
|
#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|