update decode method

This commit is contained in:
rasbt 2024-07-05 08:34:27 -05:00
parent 46f4d9e575
commit bd216fdade

View File

@ -870,7 +870,7 @@
" def decode(self, ids):\n",
" text = \" \".join([self.int_to_str[i] for i in ids])\n",
" # Replace spaces before the specified punctuations\n",
" text = re.sub(r'\\s+([,.?!\"()\\'])', r'\\1', text)\n",
" text = re.sub(r'\\s+([,.:;?!\"()\\'])', r'\\1', text)\n",
" return text"
]
},
@ -885,7 +885,7 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "daaf8cf8-d1a3-4640-a7c8-76fc398e7e0c",
"id": "4133c502-18ac-4412-9f43-01caf4efa3dc",
"metadata": {},
"outputs": [
{
@ -910,7 +910,7 @@
{
"cell_type": "code",
"execution_count": 23,
"id": "ddfe7346-398d-4bf8-99f1-5b071244ce95",
"id": "7ed395fe-dc1b-4ed2-b85b-457cc35aab60",
"metadata": {},
"outputs": [
{
@ -931,7 +931,7 @@
{
"cell_type": "code",
"execution_count": 24,
"id": "0c350ff6-2734-4e84-9ec7-d578baa4ae1b",
"id": "059367f9-7a60-4c0d-8a00-7c4c766d0ebc",
"metadata": {},
"outputs": [
{