Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Remove links from telegram text messages #943

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

diicellman
Copy link
Contributor

Description

I encountered an issue while loading data from Telegram posts/messages: if there were many links, it wouldn't pass the OpenAI moderation, resulting in the response: "Sorry, I can't answer, there are too many links." Hence, I utilized regular expressions (re) to remove the links, retaining only the domain (as it could be useful) before converting the text into a Document object.

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

  • New Loader/Tool
  • Bug fix / Smaller change
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added new unit/integration tests
  • Added new notebook (that tests end-to-end)
  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have added a library.json file if a new loader/tool was added
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

Copy link
Collaborator

@anoopshrma anoopshrma left a comment

Choose a reason for hiding this comment

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

Looks good @diicellman

@anoopshrma anoopshrma merged commit dcab51c into run-llama:main Feb 12, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants