Extract addresses Version 4 (python)

Group "Robin AI", subgroup "NER (ROBIN)"


Description

The action extracts the address from the text. Each address is stored as a dictionary, where the key is a separate element of the address

Action icon

Parameters and their settings

Property

Description

Type

Filling example

Mandatory field

Parameters

Text

The text from which the addresses will be extracted

String

Школа Евгении расположена по адресу: Нижегородская область, г.Нижний Новгород, ул.Ленина, д.100

Yes

Without the address element typeIf the value is «true», only the name of the address element will be specified. If «false», the name and type of the address element will be recorded in the dictionaryBooleantrueNo
The original view of the address elementIf the value is «true», then the type of the address element will be specified as in the source text. If «false», the dictionary will record the official full view of the address elementBooleantrueNo
Results

Result

A collection of dictionaries with extracted data. If the same address occurs several times in the text, then it will be recorded once in the resulting collection

Collection



Special conditions of use

  1. If the given text does not have any address field in the "Text" field, the value in the dictionary will return empty. If there are no all addressable elements in the text, the action will return an empty result.
  2. A dictionary is always created with a complete set of keys so that no error occurs when accessing any key in the dictionary.
  3. If "Without the address element type" and "The original view of the address element" are checked at the same time, the "The original view of the address element" checkbox will be ignored.
  4. If one sentence contains country, and city, and another sentence lists street, house, and index, that is, parts of the same entity in different sentences, they will be extracted as different addresses into separate dictionaries, not complementing each other.
  5. The "Full address" key contains the entire address string found, and the rest of the fields will be filled in according to the dictionary keys.

  6. The robot will return an empty dictionary collection if:

    • No address elements will be found in the source text.

    • Source text in an unsupported language. Russian language is supported in the current version.

Address dictionary keys:

  • Full address
  • Country
  • Subject of the Russian Federation
  • Municipal entity
  • Administrative-territorial unit
  • Settlement
  • Planning structure element
  • Element of street and road network
  • Addressing object element
  • Building type
  • Room type
  • Postal code

Reference table

Commonly accepted abbreviations of words that are included in the address and address elements are listed in the table.


Страна

Субъекты Российской Федерации
АССРРеспубликаресп., республики
УССРКрайкрай
УЗССРОбластьобл.
ССРГород федерального значенияг.ф.з.
СССРАвтономная областьа.обл., автоном. область
Автономный округа.окр., автоном. округ
Муниципальные образованияАдминистративно-территориальные единицы
Муниципальный районм.р-нПоселениепос.
Городской округг.о.
Городское поселениег.п.Районр-н
Сельское поселениес.п.
Внутригородской районвн.р-нСельсоветс/с
Внутригородская территория (внутригородское муниципальное образование) города федерального значениявн.тер.г.
Населенные пунктыЭлементы планировочной структуры
Городг.Берегб-г
Поселок городского типапгт.Валвал
Рабочий поселокрп.Жилой районж/р
Курортный поселоккп.Зона (массив)зона
Городской поселокгп.Кварталкв-л
Поселокп.Микрорайонмкр.
АалаалОстровост-в
АрбанарбанПаркпарк
АулаулПлатформаплатф.
Выселкив-киПромышленный районп/р
Городокг-кРайонр-н
Заимказ-каСадсад
Починокп-кСкверсквер
Кишлаккиш.Территориятер.
Поселок при станции (поселок станции)п. ст. Территория садоводческих некоммерческих объединений граждантер. СНО
Поселок при железнодорожной станциип. ж/д ст. Территория огороднических некоммерческих объединений граждантер. ОНО
Железнодорожный блокпостж/д бл-стТерритория дачных некоммерческих объединений граждантер. ДНО
Железнодорожная будкаж/д б-каТерритория садоводческих некоммерческих товариществтер. СНТ
Железнодорожная веткаж/д в-каТерритория огороднических некоммерческих товариществтер. ОНТ
Железнодорожная казармаж/д к-маТерритория дачных некоммерческих товариществтер. ДНТ
Железнодорожный комбинатж/д к-тТерритория садоводческих потребительских кооперативовтер. СПК
Железнодорожная платформаж/д пл-маТерритория огороднических потребительских кооперативовтер. ОПК
Железнодорожная площадкаж/д пл-каТерритория дачных потребительских кооперативовтер. ДПК
Железнодорожный путевой постж/д п.п.Территория садоводческих некоммерческих партнерствтер. СНП
Железнодорожный остановочный пунктж/д о.п.Территория огороднических некоммерческих партнерствтер. ОНП
Железнодорожный разъездж/д рзд.
Железнодорожная станцияж/д ст. Территория дачных некоммерческих партнерствтер. ДНП
Местечком-ко
Деревняд., дер.Территория товарищества собственников недвижимоститер. ТСН
Селос.
Слободасл.Территория гаражно-строительного кооперативатер. ГСК
Станцияст. 
Станицаст-цаУсадьбаус.
Улусу.Территория фермерского хозяйстватер.ф.х.
Хуторх.
Разъездрзд.Юртыю.
Зимовьезим.Совхозсвх
Элементы улично-дорожной сетиЭлементы объектов адресации
Аллеяал.Зданиезд.
Бульварб-рДомовладениедвлд.
Взвозвзв.Владениевлд.
Въездвзд.Земельный участокз/у
Дорогадор.Сооружениеcoop.
Заездззд.Домд.
КилометркмОбъект незавершенного строительстваОНС
Кольцок-цо
КосакосаТипы зданий
Линиялн.Корпуск.
Магистральмгстр.Строениестр.
Набережнаянаб.Шахташах.
Переездпер-дГаражг-ж
Переулокпер.Котельнаякот.
Площадкапл-каТипы помещений
Площадьпл.Квартиракв.
Проездпр-дКомнатаком.
Просекпр-кОфисофис
Просекапр-каПавильонпав.
Проселокпр-локПомещениепом.
Проспектпр-ктРабочий участокраб.уч.
Проулокпроул.Складскл.
Разъездрзд.Торговый залторг.зал
Ряд(ы)рядЦехцех
Скверс-рПодвалподв.
Спускс-к


Съездсзд.

Тракттракт

Тупиктуп.

Улицаул.

Шоссе

ш.

Example of use

Task

There is a text to recognize:

Обращением к архитектуре итальянского ренессанса в 1930-е годы стал знаменитый дом на Моховой, построенный в 1932–1934 годах И.В. Жолтовским по адресу: Россия, Московская область, г. Москва, ул. Моховая, д. 13. Здание строилось по заказу Моссовета как жилой дом. Шестой и седьмой этажи со стороны главного фасада занимали двухэтажные квартиры, во двор выходили комнаты-мастерские высотой в два этажа, застеклённые большими окнами-витражами.


Addresses need to be extracted from the text and written into an existing tabular document.

Solution

Use the actions: "Extract addresses", "Get keys", "Get values", "Open", "Set column values", loop "For each", "Save".

Implementation

  1. Drag the "Extract addresses" action to the workspace.

  2. Set the parameters of the "Extract addresses" action.
    Enter the text to be recognized in the "Text" field.

    Set the "The original view of the address element" parameter to "true".
  3. Drag the "Open" action to the workspace and customize the action settings.

  4. Drag the "For each" loop to the workspace.
  5. In the "Collection" parameter of the "For each" loop, add the result of the "Extract Addresses" action.

  6. Drag the "Get keys" and "Get values" actions into the "For each" loop on the workspace.

  7. Set up the "Get keys" and "Get values" action parameters.
    Add the result of the "For each" loop to the "Dictionary" parameter.

  8. Drag the "Set column values" and "Save" actions to the workspace.

  9. Set the "Set column values" action parameters. 
    1. Set context - result of "Open" action
    2. Add columns A and B to the Column name parameter
    3. Add the results of the "Get keys" and "Get values" actions to the "Cell value" parameter
    4. Set the starting line number of the range
  10. Click on the "Start" button in the top panel.

Result

The program robot completed successfully.

The extracted addresses are recorded in a tabular document.

When "true" is set to "Without the address element type", the "Extract addresses" action is set to "Extract addresses"

the resulting dictionary will not include the types of address elements:

  • Нет меток