-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bugs in dual #34
fix bugs in dual #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add merge function for TextsRepresentationOutput class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And don't forget to run pre-commit
before commit
src/xpmir/neural/dual.py
Outdated
@@ -67,6 +67,13 @@ class Dense(DualVectorScorer[QueriesRep, DocsRep]): | |||
"""A scorer based on a pair of (query, document) dense vectors""" | |||
|
|||
def score_product(self, queries, documents, info: Optional[TrainerContext] = None): | |||
# logger.info(f'info : {info} \n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
src/xpmir/neural/dual.py
Outdated
@@ -170,6 +177,13 @@ def __call__(self, info: TrainerContext, queries, documents): | |||
# Assumes that all weights are positive | |||
assert info.metrics is not None | |||
|
|||
##################################################### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comments
src/xpmir/neural/__init__.py
Outdated
return TextsRepresentationOutput(torch.cat(list(map(lambda x: x.value, objects))), TokenizedTexts(tokens, ids, lens, mask, token_type_ids)) | ||
|
||
|
||
################################################################################ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
src/xpmir/neural/__init__.py
Outdated
@@ -92,7 +92,39 @@ def merge(self, objects: Union[DocsRep, QueriesRep]): | |||
|
|||
if isinstance(objects[0], List): | |||
return list(itertools.chain(objects)) | |||
|
|||
################################################################################ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
No description provided.