Skip to content
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

More variants for embedding-based similarities #4

Open
janheinrichmerker opened this issue Mar 2, 2022 · 0 comments
Open

More variants for embedding-based similarities #4

janheinrichmerker opened this issue Mar 2, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@janheinrichmerker
Copy link
Collaborator

The STMC1, STMC2, and REG axioms depend on similarities. It might be promising to have similarity variants that are based on word embeddings fine-tuned on test collections like Robust 04.
It is only required to have some word embeddings that PyMagnitude can handle, the rest is already implemented.

To implement new embedding variants, take a look at the fastText implementation here:

class FastTextWikiNewsTermSimilarityMixin(MagnitudeTermSimilarityMixin):
embeddings_path: Final[str] = "fasttext/medium/wiki-news-300d-1M.magnitude"

Define a new similarity mixin extending MagnitudeTermSimilarityMixin and then implement variants of STMC1, STMC2, and REG like this:

@dataclass(frozen=True)
class STMC1_fastText(_STMC1, FastTextWikiNewsTermSimilarityMixin):
name = "STMC1-fastText"

@janheinrichmerker janheinrichmerker added enhancement New feature or request good first issue Good for newcomers labels Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant