Skip to content

Commit

Permalink
Merge pull request #376 from NervanaSystems/Solutions-UI-fix
Browse files Browse the repository at this point in the history
fix score files reference
  • Loading branch information
Peter Izsak authored Jun 10, 2019
2 parents 5fd88d4 + b15a07e commit 061be45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nlp_architect/solutions/trend_analysis/trend_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ def analyze(target_data, ref_data, tar_header, ref_header, top_n=10000, top_n_ve
# 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)
calc_scores(target_data, tfidf_w, cval_w, lm_w, target_scores_path)
calc_scores(ref_data, tfidf_w, cval_w, lm_w, ref_scores_path)
# unify all topics:
with open(ref_data) as f:
topics1 = sum(1 for _ in f)
with open(target_data) as f:
topics2 = sum(1 for _ in f)
sum_topics = topics1 + topics2
logger.info("sum of all topics= %s", str(sum_topics))
merge_phrases(ref_topics_path, True, hash2group, rep2rank, top_n, sum_topics)
merge_phrases(target_topics_path, False, hash2group, rep2rank, top_n, sum_topics)
merge_phrases(ref_scores_path, True, hash2group, rep2rank, top_n, sum_topics)
merge_phrases(target_scores_path, False, hash2group, rep2rank, top_n, sum_topics)
logger.info("Total number of evaluated topics: %s", str(len(rep2rank)))

# compute 2D space clusters if model exists:
Expand Down
4 changes: 2 additions & 2 deletions nlp_architect/solutions/trend_analysis/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
dir = str(LIBRARY_OUT / 'trend-analysis-data')
graph_data_path = path.join(dir, 'graph_data.csv')
filter_data_path = path.join(dir, 'filter_phrases.csv')
target_scores_path = path.join(dir, 'target_scores.csv')
ref_scores_path = path.join(dir, 'ref_scores.csv')
target_scores_path = path.join(dir, 'target_topics.csv')
ref_scores_path = path.join(dir, 'ref_topics.csv')
max_len = 50
gd = None
top_before = None
Expand Down

0 comments on commit 061be45

Please sign in to comment.