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

Feat/merge ignored nounphrases lists #118

Merged
merged 8 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 0 additions & 249 deletions annotators/fact_retrieval/remove_lists.py

This file was deleted.

7 changes: 4 additions & 3 deletions annotators/fact_retrieval/tfidf_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from deeppavlov.core.models.estimator import Component
from deeppavlov.core.common.file import read_json
from deeppavlov.core.commands.utils import expand_path
from remove_lists import NP_REMOVE_LIST, NP_IGNORE_LIST

from common.ignore_lists import FALSE_POS_NPS_LIST, BAD_NPS_LIST

logger = getLogger(__name__)

Expand All @@ -50,10 +51,10 @@ def __init__(
freq_unigrams = f.read().splitlines()[:1000]

self.np_ignore_expr = re.compile(
"(" + "|".join([r"\b%s\b" % word for word in NP_IGNORE_LIST + freq_unigrams]) + ")", re.IGNORECASE
"(" + "|".join([r"\b%s\b" % word for word in BAD_NPS_LIST + freq_unigrams]) + ")", re.IGNORECASE
)
self.np_remove_expr = re.compile(
"(" + "|".join([r"\b%s\b" % word for word in NP_REMOVE_LIST]) + ")", re.IGNORECASE
"(" + "|".join([r"\b%s\b" % word for word in FALSE_POS_NPS_LIST]) + ")", re.IGNORECASE
)
self.rm_spaces_expr = re.compile(r"\s\s+")

Expand Down
Loading