LLM-Sentence Deduplicator (MaxCompute)

Updated at:

You can use the LLM-Sentence Deduplicator component of Platform for AI (PAI) to deduplicate sentences in an article during text preprocessing for large language models (LLMs).

Limits

Support is limited to the MaxCompute compute engine.

Algorithm introduction

The algorithm first splits the text by line feeds. It then segments the sentences in each line using punctuation marks such as .,!,?,...,\\?,!,.",!",\\?",!", and ?". Finally, it uses the hashlib.sha1 hash algorithm to calculate a hash value for each sentence and remove any duplicates.

Configure the component in the PAI console

Designer lets you visually configure component parameters.

Tab

Parameter

Required

Description

Default value

Fields Setting

Select Target Column

Yes

The columns that you want to process. You can select multiple columns.

N/A

Set output table lifecycle

No

A positive integer that specifies the lifecycle in days. After the specified period, the temporary table is deleted. Default value: 28.

28

Execution Tuning

Number of CPUs per Instance

No

The number of CPUs for each instance of a map task. Valid values: 50 to 800.

100

Memory Per Instance (MB)

No

The memory size of each instance of a map task. Unit: MB. Valid values: 256 to 12288.

1024

Processed Data per Instance (MB)

No

The maximum amount of data that each instance of a map task can process. You can control the input of the map using this parameter. Unit: MB. Valid values: [1, Integer.MAX_VALUE].

256

References

For information about Machine Learning Designer components, see Designer overview.