Skip to content

Commit

Permalink
minor refaactoring of param name, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
bgajdero committed Dec 9, 2024
1 parent 500abb6 commit c710d30
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Question and Answer Wrapper

## To run example
`conda activate PyQAWrapper`

`python -m src.qa0`
`python -m src.qa1`
`cd src`
`python -m qawrapper.main_qa0`
`python -m qawrapper.main_qa1`

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qawrapper"
version = "0.0.1"
version = "0.0.2"
description = "Python wrapper for QuestionAnswer Interface"
authors = [
{ name = "Bart Gajderowicz", email = "[email protected]" },
Expand Down
4 changes: 2 additions & 2 deletions src/qawrapper/qa/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ def top_answers(self):
self.qa_info = {out_entity: self.QAs[out_entity][0] for out_entity in self.QAs}
return self.qa_info

def run_qa(self, ner=False):
def run_qa(self, adjust_score=False):
"""Do all from setting the question to selecting the top answers
:return: top answers
"""
self.set_questions()
self.set_answers(ner)
self.set_answers(adjust_score)
self.qa_info = self.top_answers()
return self.qa_info

Expand Down
6 changes: 3 additions & 3 deletions src/qawrapper/qa0.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QA0(QA):
set_questions()
prepare the results formatting and set questions
set_answers(ner)
set_answers(adjust_score)
run the qa model to get answers
get_agg_score(out_entity)
Expand Down Expand Up @@ -80,7 +80,7 @@ def set_questions(self):
return e
self.QAs = new_QAs

def set_answers(self, ner):
def set_answers(self, adjust_score):
"""
Run the model and add the outputted information to QAs
:param ner: boolean that tells whether this result will be ner or phrase data level hypothesis
Expand All @@ -96,7 +96,7 @@ def set_answers(self, ner):
qa["answer"] = res["answer"]
qa["start"] = res["start"]
qa["end"] = res["end"]
if ner:
if adjust_score:
qa["score"] = res["score"] * 0.3 + self.get_agg_score(out_entity) * 0.7
else:
qa["score"] = res["score"]
Expand Down

0 comments on commit c710d30

Please sign in to comment.