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

Update website_crawler.py to keep clean urls #114

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

nespera
Copy link
Contributor

@nespera nespera commented Aug 21, 2024

It looks like the website crawler normalizes the URLs it gathers but then immediately throws them away. This change keeps the normalized list.

@@ -79,7 +79,6 @@ def crawl(self) -> None:
pos_regex=self.pos_regex, neg_regex=self.neg_regex,
indexer=self.indexer, visited=set(), verbose=self.indexer.verbose)
urls = clean_urls(urls_set, keep_query_params)
urls = list(set(urls_set))
Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch, but I think the idea of line 82 is really to remove duplicates, so should have been
"urls = list(set(urls))"
instead of removing this altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But clean_urls is also removing duplicates with the same mechanism isn't it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes you are right!

Copy link
Collaborator

@ofermend ofermend left a comment

Choose a reason for hiding this comment

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

LGTM.

@ofermend ofermend merged commit cbdfac4 into vectara:main Aug 21, 2024
@nespera nespera deleted the normalize_urls branch August 29, 2024 14:28
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