Skip to main content

header

Описание

Разборка украинского адреса на типы

Read this in other language: English, Русский, Український

Требования

  • python3
  • spacy
  • re
  • pandas
  • xlrd
  • csv
  • os
  • signal
  • threading

Создание модели

python3 train.py

Обучить модель

python3 -m spacy train config/config.cfg --paths.train training/train.spacy --paths.dev training/test.spacy --output models

Обучить более точнее модель

python3 -m spacy train config/config_acc.cfg --paths.train training/train.spacy --paths.dev training/test.spacy --output models

Проверка модели

python3 example.py

Создать файл описания модели

python3 -m spacy init fill-config config/base_config.cfg config/config.cfg

Создать файл описания более точной модели

python3 -m spacy init fill-config config/base_config_acc.cfg config/config_acc.cfg

Примеры

import uaddresspacy

print(uaddresspacy.parse(", - полтавська чутівський жовтневе вул. -, буд. -, кв.,"))
# [('полтавська', 'Locality'), ('чутівський', 'CountyType'), ('жовтневе', 'Locality'), ('вул.', 'StreetType'), ('буд.', 'HouseNumberType'), ('кв.', 'ApartmentType')]
print(uaddresspacy.parse(", 01000 київ, місто київ, місто київ воровського, буд. 43-б, кв. 14,"))
# [('01000', 'PostCode'), ('київ', 'Region'), ('місто', 'LocalityType'), ('київ', 'Locality'), ('воровського', 'Street'), ('буд.', 'HouseNumberType'), ('43-б', 'HouseNumber'), ('кв.', 'ApartmentType'), ('14', 'Apartment')]

Структура

Файл Описание
pretrain.py Подготовка данных для обучения модели
train.py Подготовка модели
example.py Получить пример разборки адреса на типы
raw.csv Данные для обучения
report.csv Пример результата обработки на типы
addresses.csv Список адресов для проверки
training/pretrain.csv Данные для обучения модели

Типы

Название Описание
Country Страна
RegionType Тип области
Region Область
CountyType Тип района
County Район
Included Входит в состав
LocalityType Тип населённого пункта
Locality Населённый пункт
StreetType Тип улицы
Street Улица
HousingType Тип корпуса
Housing Корпус
HostelType Тип общежития
Hostel Общежитие
HouseNumberType Тип номера дома
HouseNumber Номер дома
HouseNumberAdditionally Дополнительный номер дома
SectionType Тип секции
Section Секция
ApartmentType Тип квартиры
Apartment Квартира
RoomType Тип комнаты
Room Комната
Sector Сектор
FloorType Тип этажа
Floor Этаж
PostCode Индекс
Manually Набор типов для дальнейшей разборки адреса
NotAddress Не адрес
Comment Комментарий
AdditionalData Дополнительные данные

Metadata

Release files for uaddresspacy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uaddresspacy 1.0.0
File Size Uploaded
uaddresspacy-1.0.0.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uaddresspacy 1.0.0
File Interpreter ABI Platform
uaddresspacy-1.0.0-py3.8.egg Legacy Egg format - - Details

Total release size: 7.2 kB

Release files / uaddresspacy-1.0.0.tar.gz

Download URL uaddresspacy-1.0.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2561acf2ff5c5dd5b595efe47d9274bccd7071c000880529b57fdd9c9dce57f6
BLAKE2b-256 checksum
How to use checksums
50e98ace6abceec3caf915ed5b0d7b1174d48733351fb06755ac45119468c07e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/60.2.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.8.10

Release files / uaddresspacy-1.0.0-py3.8.egg

Download URL uaddresspacy-1.0.0-py3.8.egg
Size 3.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
2091153a550d94b924e9ea11ee4ef279354e18d8d339d9e3896a9f7fdd753196
BLAKE2b-256 checksum
How to use checksums
5a62d560c43e196f8d7cbc07d908bef2b8f1e82eed6a4c396065bb187ec71a2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/60.2.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page