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 type | If 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 dictionary | Boolean | true | No |
The original view of the address element | If 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 element | Boolean | true | No |
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
- 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.
- A dictionary is always created with a complete set of keys so that no error occurs when accessing any key in the dictionary.
- 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.
- 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.
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.
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.
Example of use
Task
There is a text to recognize:
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
- Drag the "Extract addresses" action to the workspace.
- 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". - Drag the "Open" action to the workspace and customize the action settings.
- In the "Collection" parameter of the "For each" loop, add the result of the "Extract Addresses" action.
- Drag the "Get keys" and "Get values" actions into the "For each" loop on the workspace.
- Set up the "Get keys" and "Get values" action parameters.
Add the result of the "For each" loop to the "Dictionary" parameter. - Drag the "Set column values" and "Save" actions to the workspace.
- Set the "Set column values" action parameters.
- Set context - result of "Open" action
- Add columns A and B to the Column name parameter
- Add the results of the "Get keys" and "Get values" actions to the "Cell value" parameter
- Set the starting line number of the range
- 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: