Spec-Zone.ru › TensorFlow 2.3

tf.keras.preprocessing.text.text_to_word_sequence

View source on GitHub

Преобразует текст в последовательность слов (или токенов).

Просмотр псевдонимов

Псевдонимы для миграции

См. Руководство по миграции для получения более подробной информации.

tf.compat.v1.keras.preprocessing.text.text_to_word_sequence

tf.keras.preprocessing.text.text_to_word_sequence(
    input_text, filters='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~\t\n', lower=True, split='
    '
)

Эта функция преобразует строку текста в список слов, игнорируя filters символы, включая знаки препинания по умолчанию.

sample_text = 'This is a sample sentence.'
tf.keras.preprocessing.text.text_to_word_sequence(sample_text)
['this', 'is', 'a', 'sample', 'sentence']
Аргументы
input_text Входной текст (строка).
filters список (или объединение) символов для фильтрации, таких как знаки препинания. По умолчанию: '!"#$%&()*+,-./:;<=>?@[\]^_{|}~\t\n', includes basic punctuation, tabs, and newlines. </td> </tr><tr> <td>нижний регистр</td> <td> boolean. Whether to convert the input to lowercase. </td> </tr><tr> <td>разделение` str. Разделитель для разделения слов.
Возвращаемые значения
Список слов (или токенов).

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/keras/preprocessing/text/text_to_word_sequence

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API