Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Extract dates Version 1 (python)

Группа Group "Robin AI", подгруппа subgroup "NER (ROBIN)"

...

Description

The action extracts dates from the text

...

Action icon

...

Parameters

Входные параметры

  • Текст – текст, из которого будут извлечены даты.

Выходные параметры

Input parameters

  • Text – the text from which the dates will be extracted.

Output parameters

  • Dates - a collection with extracted data in Даты – коллекция с извлеченными данными в формате dd.mm.yyyy . Недостающий элемент даты будет записан как «01».
    Если одна и та же дата встречается в тексте несколько раз, то в результирующей коллекции она будет записана один раз.
  • Извлеченные данные – коллекция с извлеченными данными без приведения типа.
    Если одна и та же дата встречается в тексте несколько раз, то в результирующей коллекции она будет записана один раз.

...

  • format. The missing date element will be recorded as "01".
    If the same date occurs several times in the text, it will be recorded once in the resulting collection.
  • Extracted data - a collection with extracted data without type conversion.
    If the same date occurs several times in the text, it will be recorded once in the resulting collection.

Settings

Property

Description

Type

Filling example

Mandatoryfield

Parameters

Text

The text from which the dates will be extracted

String

Христофор Колумб был убежден, что сможет добраться до Индии на корабле. Получил поддержку и финансирование Изабеллы Кастильской. Отплыв из Палос-де-ла-Фронтера 3 августа 1492 года, он достиг Сан-Сальвадора 12 октября 1492 года. Название континента Америка, связано с фигурой Америго Веспуччи, итальянского мореплавателя и исследователя, который понимал, что земли, открытые Колумбом были частью новой земли, еще неизведанной.

Yes

Results

Dates

A collection with extracted data.The missing date element will be written as «01». If the same date occurs several times in the text, then it will be recorded once in the resulting collection

Collection



Extracted dataA collection with extracted data in string format. If the same date occurs several times in the text, then it will be recorded once in the resulting collectionCollection

Особые условия использования 



Special conditions of use 

  1. The action does not retrieve time and dates in words.
  2. If only a number is specified, the date will not be retrieved. For example: "14" without month and year.
  3. If a date is specified in an invalid format, the action will not retrieve the date. 
  4. If no day, month or year is specified, the minimum possible value will be substituted into the value.
  5. For example, "May 19" will be converted to
  6. Действие не извлекает время и даты прописью.
  7. Если указано только число, дата не будет найдена. Например: "14" без месяца и года.
  8. Если указана дата в неверном формате, то действие дату не извлечет. 
  9. Если не указан день, месяц или год, в значении будет подставлено минимальное возможное значение. Например, "19 мая" будет преобразовано в "19.05.0001"; "В мае May 23 года" будет преобразовано в " will be converted to "01.05.2023".
  10. Если указанный текст не содержит дат, то действие вернет пустые коллекции.
  11. If the specified text does not contain dates, the action will return empty collections.

Examples of valid date formatsПримеры допустимых форматов дат:

  • 19.05.2023
  • 19.05.2023 гy/годyear
  • 19.05.99
  • 2023 годyear
  • 2023 гy
  • 19 маяMay
  • май May 2023 гy/годyear
  • 19 мая May 2023 гy/годyear
  • 19/05/2023
  • 19-05-2023
  • "14" апреля April 2022
  • «14» апреля April 2022

Пример использования 

Задача

Example of use 

Task

There is a text to recognizeИмеется текст для распознавания:

Пушкин родился 26.05.1799 г. в Москве. Здесь юный поэт пережил события Отечественной войны 1812 года. Из лицея Пушкин был выпущен 9 июня 1817 года. 16 августа Пушкин прибыл в Феодосию.

Необходимо извлечь из текста даты, извлеченные данные и вывести результат в диалоговое окно.

Решение

 Воспользоваться действиями "Извлечь дату", "Конвертировать данные" и "Сообщение". 

Реализация

...

You need to extract dates from the text, extracted data, and display the result in a dialog box.

Solution

Use the "Extract dates", "Convert data" and "Message" actions. 

Implementation

  1. Create variables "Collection with dates" and "Collection with extracted data" into which the results of the "Extract dates" action will be written.
    Image AddedImage Added

  2. Transfer the "Extract dates" action to the workspace.
    Image Added

  3. Fill in the "Text" parameter of the "Extract dates" action.
    Add appropriate variables to the results of the action.
    Image Added

  4. Drag the "Convert data" action to the workspace.Image Added

  5. Set the "Convert data" action parameters.
    In the "Source" field add the created variable.
    Select the "String" option in the "Type" field.
    Image AddedImage Added

  6. Drag the "Message" action to the workspace. 
    Image Added

  7. Set the parameters of the "Message" action.
    In the "Message text" field add the results of the "Convert data" action.
    Image AddedImage Added

  8. Click on the "Start" button in the top panel.

Result

The program robot completed successfully. The required values are displayed in the dialog boxes

...

Результат

Программный робот отработал успешно. В диалоговые окна выведены требуемые значения.