Skip to content

Commit

Permalink
Merge branch 'master' into Solutions-UI-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Izsak authored Jun 2, 2019
2 parents 5cf517d + 27ed482 commit a417c65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion nlp_architect/solutions/trend_analysis/trend_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
logger = logging.getLogger(__name__)
target_topics_path = path.join(dir, 'target_topics.csv')
ref_topics_path = path.join(dir, 'ref_topics.csv')
target_scores_path = path.join(dir, 'target_scores.csv')
ref_scores_path = path.join(dir, 'ref_scores.csv')


def analyze(target_data, ref_data, tar_header, ref_header, top_n=10000, top_n_vectors=500,
Expand Down Expand Up @@ -65,7 +67,9 @@ def analyze(target_data, ref_data, tar_header, ref_header, top_n=10000, top_n_ve
create_clusters = False
try:
if not re_analysis: # first analysis, not through ui
copyfile(target_data, target_topics_path)
copyfile(target_data, target_topics_path) # copying the initial
# scores file to have a const filename for the ui to recognize
# when reanalyzing
copyfile(ref_data, ref_topics_path)
calc_scores(target_data, tfidf_w, cval_w, lm_w, target_topics_path)
calc_scores(ref_data, tfidf_w, cval_w, lm_w, ref_topics_path)
Expand Down
6 changes: 3 additions & 3 deletions nlp_architect/solutions/trend_analysis/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
css_classes=['filter_custom_table'])
radio_group_area = RadioGroup(
labels=["All", "Top Topics", "Trends", "Trend Clustering", "Custom Trends", "Topic Clustering",
"Filter"], active=0, inline=True, width=400)
"Filter"], active=0, orientation="vertical", height=150)
n_menu = [("5", "5"), ("10", "10"), ("20", "20"), ("30", "30")]
n_clusters_menu = [("20", "20"), ("50", "50"), ("100", "100"), ("300", "300"), ("500", "500")]
scores = [("0", "0"), ("0.1", "0.1"), ("0.25", "0.25"), ("0.5", "0.5"), ("1", "1")]
Expand Down Expand Up @@ -119,7 +119,7 @@
[
[Div(width=500), Div(text="<H1>AIPG Trend Analysis</H1>")],
[label],
[config_area, Div(width=50), graphs_area]
[config_area, graphs_area]
]
)

Expand Down Expand Up @@ -753,7 +753,7 @@ def search_topic_callback():
refresh_filter_area()


def tab_changed_callback(_):
def tab_changed_callback(active, old, new):
reset_filters()


Expand Down

0 comments on commit a417c65

Please sign in to comment.