Commit dffb6b10 authored by Jerome Wuerf's avatar Jerome Wuerf
Browse files

Merge branch 'check-for-same-stance-stance' into 'main'

Check for same stance stance

See merge request !13
parents fa7fe118 3baa595d
......@@ -33,8 +33,8 @@ services:
python -m debugpy --wait-for-client --listen 0.0.0.0:5678 \
/app/src/prototype/app.py retrieval \
--nrb-conclusions-per-topic 100 --nrb-premises-per-conclusion 50 \
--reranking argument-graph --reuse-unranked /data/unranked.plk \
test-run /data/topics.xml /data/results/
--reranking maximal-marginal-relevance --reuse-unranked /data/unranked.plk \
test-run-new /data/topics.xml /data/results/
# entrypoint:
# - "/bin/sh"
# - -ecx
......
......@@ -42,7 +42,9 @@ class App:
).index_to_es()
def _retrieval(self) -> None:
run_name = self.config['RERANKING'] if self.config['RERANKING'] else 'double-index-semantic'
run_name = f"{self.config['RUN_NAME']}-"
run_name += self.config['RERANKING'] if self.config['RERANKING'] \
else 'double-index-semantic'
self.logger.info('Reading topics...')
topics = read_topics(self.config['TOPICS_PATH'], self.config['TOPIC_NRB'])
self.logger.info('Read topics!')
......@@ -53,7 +55,7 @@ class App:
self.logger.info('Read unranked!')
else:
results = Retrieval(topics,
self.config['RUN_NAME'],
run_name,
self.config['ELASTIC_HOST'],
self.config['NRB_CONCLUSIONS_PER_TOPIC'],
self.config['NRB_PREMISES_PER_CONCLUSION']
......
......@@ -58,7 +58,10 @@ class Reranking:
for premises_per_conclusion in premises_pre_conclusions.values():
conclusion = premises_per_conclusion['conclusion']
for premise in premises_per_conclusion['premises']:
if not premise['_id'] in encountered_premise_ids:
stance_conclusion = conclusion['_source']['sentence_stance']
stance_premise = premise['_source']['sentence_stance']
if stance_conclusion == stance_premise \
and premise['_id'] not in encountered_premise_ids:
trec_style_rows.append(
(topic_nrb,
conclusion['_source']['sentence_stance'],
......
......@@ -5,3 +5,4 @@ from utils.structural_distance import structural_distance
from utils.maximal_marginal_relevance import mmr_score, mmr_generic
from utils.reader import (read_data_to_index,
read_results, read_unranked, read_sentences, read_topics)
from utils.write_output import write_output
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment