(dataset_folder)
return 1
To patch the all chunk files of the train & test dataset that have the problem of duplicate last character
	of the last cell in all chunk files
	:param dataset_folder: train dataset path
	:return: 1
To patch the all chunk files of the train & test dataset that have the problem of duplicate last character
	of the last cell in all chunk files
	:param dataset_folder: train dataset path
	:return: 1
To patch the all chunk files of the train & test dataset that have the problem of duplicate last character of the last cell in all chunk files : param dataset_folder : train dataset path : return : 1
def patch_chunks(dataset_folder):
	"""
	To patch the all chunk files of the train & test dataset that have the problem of duplicate last character
	of the last cell in all chunk files
	:param dataset_folder: train dataset path
	:return: 1
	"""
	import os
	import shutil
	from pathlib import Path

	shutil.move(os.path.join(dataset_folder, "chunk"), os.path.join(dataset_folder, "chunk-old"))
	dir_ = Path(os.path.join(dataset_folder, "chunk-old"))
	os.makedirs(os.path.join(dataset_folder, "chunk"), exist_ok=True)

	for chunk_path in dir_.iterdir():
		# print(chunk_path)
		with open(str(chunk_path), encoding="utf-8") as f:
			chunks = json.load(f)['chunks']
		chunks[-1]['text'] = chunks[-1]['text'][:-1]

		with open(str(chunk_path).replace("chunk-old", "chunk"), "w", encoding="utf-8") as ofile:
			json.dump({"chunks": chunks}, ofile)
	print("Input files patched, ready for the use")
	return 1
def patch_chunks ( dataset_folder ) : import os import shutil from pathlib import Path shutil . move ( os . path . join ( dataset_folder , "chunk" ) , os . path . join ( dataset_folder , "chunk-old" ) ) dir_ = Path ( os . path . join ( dataset_folder , "chunk-old" ) ) os . makedirs ( os . path . join ( dataset_folder , "chunk" ) , exist_ok = True ) for chunk_path in dir_ . iterdir ( ) : # print(chunk_path) with open ( str ( chunk_path ) , encoding = "utf-8" ) as f : chunks = json . load ( f ) [ 'chunks' ] chunks [ - 1 ] [ 'text' ] = chunks [ - 1 ] [ 'text' ] [ : - 1 ] with open ( str ( chunk_path ) . replace ( "chunk-old" , "chunk" ) , "w" , encoding = "utf-8" ) as ofile : json . dump ( { "chunks" : chunks } , ofile ) print ( "Input files patched, ready for the use" ) return 1