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: html loader support metadata extraction from URL #98

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

Mini256
Copy link
Member

@Mini256 Mini256 commented Apr 11, 2024

part of #121

For example:

If there is a document URL as below:

https://docs.pingcap.com/tidb/v6.5/character-set-and-collation

The reader config:

{
  "reader": {
    "rag.loader.html": {
      "metadataExtraction": [
        {
          "extractors": [
            {
              "defaultMetadata": {
                "language": "en",
                "version": "stable"
              },
              "type": "url-metadata-extractor",
              "urlMetadataPattern": "/:language(zh|ja)?/:product(tidb|tidbcloud|tidb\\-data\\-migration|tidb\\-in\\-kubernetes)/:version(dev|stable|v\\d.\\d)(/.*)"
            }
          ],
          "urlPattern": "docs.pingcap.com/**"
        }
      ]
  }
}

The html loader will got the metadata as follows:

{
    "documentMetadata": {
      "language": "en",
      "product": "tidb",
      "version": "v6.5"
    }
}

Copy link

vercel bot commented Apr 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rag ❌ Failed (Inspect) Apr 19, 2024 0:56am
rag-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:56am
tidb-ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:56am

@Mini256 Mini256 marked this pull request as ready for review April 19, 2024 12:53
@Mini256 Mini256 changed the title feat: html loader support metadata extraction feat: html loader support metadata extraction from URL Apr 19, 2024
@Mini256 Mini256 merged commit eee126e into main Apr 19, 2024
3 checks passed
@Mini256 Mini256 deleted the html-loader-support-metadata-extraction branch April 19, 2024 13:04
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.

1 participant