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

Add web/knowledgebase crawler #771

Merged
merged 27 commits into from
Feb 14, 2024
Merged

Add web/knowledgebase crawler #771

merged 27 commits into from
Feb 14, 2024

Conversation

rishimo
Copy link
Contributor

@rishimo rishimo commented Jan 29, 2024

🤔 Why?

SC23110

Adds a connector that can crawl webpages with an adjustable recursion depth. Retrieves all unique subpages found and creates External Search Documents accordingly.

🤓 What?

Adds an extractor and methods to:

  • Retrieve a given page's subpages with some level of recursion
  • Extracts the visible text on the page
  • Extracts the page title
  • Creates Document objects, generates embeddings, and maps the metadata back to the text nodes.

🧪 Tested?

Unit tests, tested manually on several different pages and generates valid documents.

This only works on pages where the subpage URLs are immediately visible; if another element has to be clicked (script, etc.) to reveal elements those will not be found.

☑️ Checks

  • My PR contains actual code changes, and I have updated the version number in pyproject.toml.

Copy link

This pull request has been linked to Shortcut Story #23110: Create initial extractor for static / public pages.

Copy link

github-actions bot commented Jan 31, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
15966 14762 92% 85% 🟢

New Files

File Coverage Status
metaphor/static_web/config.py 100% 🟢
metaphor/static_web/extractor.py 98% 🟢
TOTAL 99% 🟢

Modified Files

File Coverage Status
metaphor/notion/config.py 100% 🟢
TOTAL 100% 🟢

updated for commit: dc43b31 by action🐍

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a5b9785) 92.21% compared to head (dc43b31) 92.45%.

Files Patch % Lines
metaphor/static_web/extractor.py 98.24% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #771      +/-   ##
==========================================
+ Coverage   92.21%   92.45%   +0.24%     
==========================================
  Files         194      156      -38     
  Lines       15999    15966      -33     
==========================================
+ Hits        14754    14762       +8     
+ Misses       1245     1204      -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rishimo rishimo marked this pull request as ready for review February 7, 2024 19:04
@rishimo rishimo mentioned this pull request Feb 7, 2024
1 task
@rishimo rishimo requested a review from prith189 February 14, 2024 23:20
Copy link

@prith189 prith189 left a comment

Choose a reason for hiding this comment

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

LGTM

@rishimo rishimo merged commit 0e702ea into main Feb 14, 2024
6 checks passed
@rishimo rishimo deleted the rishimohan/sc-23110/web-crawler branch February 14, 2024 23:36
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