Skip to content

Fix: move import to class __init__ and add RecursiveCharacterSplitter#141

Merged
SayaZhang merged 10 commits intoCambioML:mainfrom
SayaZhang:main
Feb 3, 2024
Merged

Fix: move import to class __init__ and add RecursiveCharacterSplitter#141
SayaZhang merged 10 commits intoCambioML:mainfrom
SayaZhang:main

Conversation

@SayaZhang
Copy link
Collaborator

No description provided.

@CambioML CambioML changed the title Fix: move import to class __init__. Fix: move import to class __init__ and add RecursiveCharacterSplitter Jan 25, 2024
return output_nodes

def recursive_splitter(self, text: str, separators: List[str]) -> List[str]:
"""Split incoming text and return chunks."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we add missing Args and Returns in the docstring. Meanwhile, could you please add a bit more comment regarding what is a recursive splitter and how it works to ease the review. Sorry. I am not on top of how it works.

@notion-workspace
Copy link

"""Extract txt Flow Constructor."""
super().__init__()
self._extract_txt_op = ExtractTxtOp(name="extract_txt_op")
self._process_txt_op = ProcessTxtOp(name="process_txt_op")
Copy link
Collaborator

@CambioML CambioML Feb 1, 2024

Choose a reason for hiding this comment

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

qq: I thought ProcessTxtOp is used re to split extracted txt string. What is the difference between the self._process_txt_op and self._split_op?

resp = requests.get(url=value_dict["url"], timeout=300)
resp = self._requests_client.get(url=value_dict["url"], timeout=300)
text = resp.text
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we update this else to check filename and then add a else case to log regarding a specific extract format is not supported. This should help improved the readability.

@notion-workspace
Copy link

@SayaZhang SayaZhang merged commit d8d4573 into CambioML:main Feb 3, 2024
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