Skip to content

Commit

Permalink
Merge pull request #2 from zentavious/boyapati/locality_classifier
Browse files Browse the repository at this point in the history
Deleted subject_code from topics.py
  • Loading branch information
zentavious authored Nov 22, 2024
2 parents 13959eb + 4587fb0 commit efea384
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/poprox_recommender/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ def extract_locality_topics(article: Article) -> set[str]:
return article_topics.intersection(locality_topics)


def extract_locality_codes(article: Article) -> set[str]:
if "raw_data" in article and "subject" in article.raw_data:
article_codes = set([sub.code for sub in article.raw_data.subject if sub.code and len(sub.code) == 1])
locality_codes = ["a", "i", "w"]
return article_codes.intersection(locality_codes)
return []


def extract_locality(article: Article) -> list[str]:
topics = extract_general_topics(article)
codes = extract_locality_codes(article)

us_criteria = ("U.S. news" in topics) or ("a" in codes)

Check failure on line 28 in src/poprox_recommender/topics.py

View workflow job for this annotation

GitHub Actions / Report lint failures

Ruff (F821)

src/poprox_recommender/topics.py:28:54: F821 Undefined name `codes`
world_criteria = ("World news" in topics) or ("i" in codes)

Check failure on line 29 in src/poprox_recommender/topics.py

View workflow job for this annotation

GitHub Actions / Report lint failures

Ruff (F821)

src/poprox_recommender/topics.py:29:58: F821 Undefined name `codes`
Expand Down

0 comments on commit efea384

Please sign in to comment.