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

Allow running multiple analyzer models #800

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

davidfischer
Copy link
Collaborator

The setting settings.ADSERVER_ANALYZER_BACKEND can now be a list and multiple analyzers will be run and combined.

Testing

Ensure the docker container is built with the eatopics model. Due to some versioning issues with the model (not being in the form of vX.Y.Z), I built a new wheel for it.

ADSERVER_ANALYZER_BACKEND=adserver.analyzer.backends.TextacyAnalyzerBackend,adserver.analyzer.backends.EthicalAdsTopicsBackend  ./manage.py shell
from adserver.analyzer.tasks import analyze_url
analyze_url('https://pytorch.org/get-started/locally/', 'readthedocs')

The setting `settings.ADSERVER_ANALYZER_BACKEND` can now be a list
and multiple analyzers will be run and combined.
@davidfischer davidfischer requested a review from a team as a code owner October 27, 2023 19:09
Comment on lines 48 to 49
for kw in analyzed_keywords:
keywords.append(kw)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just use keywords.extend(analyzed_keywords)?

@davidfischer davidfischer merged commit 294e7be into main Nov 1, 2023
1 check passed
@davidfischer davidfischer deleted the davidfischer/multiple-keyword-models branch November 1, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants