You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"<a href=\"https://colab.research.google.com/github/sugarforever/LangChain-Tutorials/blob/main/LangChain_TextSplitter.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
29
+
]
30
+
},
31
+
{
32
+
"cell_type": "markdown",
33
+
"source": [
34
+
"In this notebook, I will show you the main text splitters LangChain framework supports."
35
+
],
36
+
"metadata": {
37
+
"id": "amP-lCFgKUb-"
38
+
}
39
+
},
40
+
{
41
+
"cell_type": "code",
42
+
"execution_count": 92,
43
+
"metadata": {
44
+
"id": "TO7WJgpwKLA-"
45
+
},
46
+
"outputs": [],
47
+
"source": [
48
+
"!pip install -qU langchain"
49
+
]
50
+
},
51
+
{
52
+
"cell_type": "code",
53
+
"source": [
54
+
"long_text = '''\n",
55
+
"WASHINGTON (Reuters) -Former U.S. President Donald Trump faces 37 criminal counts including charges of unauthorized retention of classified documents and conspiracy to obstruct justice after leaving the White House in 2021, according to federal court documents made public on Friday.\n",
56
+
"\n",
57
+
"The Justice Department made the charging documents public on a tumultuous day in which two of Trump's lawyers quit the case and a former aide face charges as well.\n",
58
+
"\n",
59
+
"The charges stem from Trump's treatment of sensitive government materials he took with him when he left the White House in January 2021.\n",
60
+
"\n",
61
+
"He is due to make a first court appearance in the case in a Miami court on Tuesday, a day before his 77th birthday.\n",
62
+
"\n",
63
+
"The indictment of a former U.S. president on federal charges is unprecedented in American history and emerges at a time when Trump is the front-runner for the Republican presidential nomination next year.\n",
64
+
"\n",
65
+
"Investigators seized roughly 13,000 documents from Trump's Mar-a-Lago estate in Palm Beach, Florida, nearly a year ago. One hundred were marked as classified, even though one of Trump's lawyers had previously said all records with classified markings had been returned to the government.\n",
"WARNING:langchain.text_splitter:Created a chunk of size 284, which is longer than the specified 50\n",
122
+
"WARNING:langchain.text_splitter:Created a chunk of size 163, which is longer than the specified 50\n",
123
+
"WARNING:langchain.text_splitter:Created a chunk of size 136, which is longer than the specified 50\n",
124
+
"WARNING:langchain.text_splitter:Created a chunk of size 115, which is longer than the specified 50\n",
125
+
"WARNING:langchain.text_splitter:Created a chunk of size 204, which is longer than the specified 50\n"
126
+
]
127
+
},
128
+
{
129
+
"output_type": "stream",
130
+
"name": "stdout",
131
+
"text": [
132
+
"WASHINGTON (Reuters) -Former U.S. President Donald Trump faces 37 criminal counts including charges of unauthorized retention of classified documents and conspiracy to obstruct justice after leaving the White House in 2021, according to federal court documents made public on Friday.\n",
133
+
"The Justice Department made the charging documents public on a tumultuous day in which two of Trump's lawyers quit the case and a former aide face charges as well.\n"
"page_content='\\nWASHINGTON (Reuters) -Former U.S. President Donald Trump faces 37 criminal counts including charges of unauthorized retention of classified documents and conspiracy to obstruct justice after leaving the White House in 2021, according to federal court documents made public on Friday.\\n' metadata={}\n"
"page_content=\"\\nThe Justice Department made the charging documents public on a tumultuous day in which two of Trump's lawyers quit the case and a former aide face charges as well.\\n\\nThe charges stem from Trump's treatment of sensitive government materials he took with him when\" metadata={}\n"
0 commit comments