Skip to main content

The amazing Murre will normalize non-standard Finnish and Swedish, and dialectalize standard Finnish!

Project description

🐶 Murre 🐕

CC BY NC ND

The amazing Murre (genitive Murren 🐕) will normalize non-standard Finnish (puhekieli) to standard Finnish (kirjakieli). This repository is maintained by Mika Hämäläinen.

Installation

This library is designed for Python 3 and it may not work on Python 2.

pip3 install murre
python3 -m murre.download

Normalize

To normalize Finnish, all you need to do is to run:

from murre import normalize_sentence

normalize_sentence("mä syön paljo karkkii")
>> minä syön paljon karkkia

You can normalize multiple sentences at the same time by running

from murre import normalize_sentences

sents = ["kissa syö karkkii", "jok laulaa tuol puole", "en tiiä oikee et kuka se o", "kyl on hölömöö"]
normalize_sentences(sents)
>> ['kissa syö karkkia', 'joka laulaa tuolla puolen', 'en tiedä oikein että kuka se on', 'kyllä on hölmöä']

Historical Finnish

To normalize (and lemmatize) historical Finnish, run:

from murre import normalize_sentence

normalize_sentence("paluellen herra caiken", language="fin_hist")
>> palvella herra kaikki

Swedish

You can use the Swedish model by passing language=swe

from murre import normalize_sentence

normalize_sentence("int vet ja", language="swe")
>> inte vet jag

Generate

Murre can also generate different dialects. All you need to do, is to run:

from murre import dialectalize_sentence
dialectalize_sentence("kodin takana on koira", "Inkerinsuomalaismurteet")
>> 'kojin takan on koira'

Or for multiple sentences:

from murre import dialectalize_sentences
sents = ["kissa syö karkkia", "kädellä on perhonen", "kettu juoksee sutta karkuun"]
dialectalize_sentences(sents,'Kainuu')
>> ['kissa syöpi karkkia', 'käellä om perhonej', 'kettu juoksee sutta karkuu']

The list of available dialects can be obtained by:

from murre import supported_dialects
supported_dialects()
>> ['Pohjois-Satakunta', 'Keski-Karjala', 'Kainuu', 'Etelä-Pohjanmaa', 'Etelä-Satakunta', 'Pohjois-Savo', 'Pohjois-Karjala', 'Keski-Pohjanmaa', 'Kaakkois-Häme', 'PohjoinenKeski-Suomi', 'Pohjois-Pohjanmaa', 'PohjoinenVarsinais-Suomi', 'Etelä-Karjala', 'Länsi-Uusimaa', 'Inkerinsuomalaismurteet', 'LäntinenKeski-Suomi', 'Länsi-Satakunta', 'Etelä-Savo', 'Länsipohja', 'Pohjois-Häme', 'EteläinenKeski-Suomi', 'Etelä-Häme', 'Peräpohjola']

Business solutions

Rootroo logo

Non-standard dialectal data can be a mess to deal with when you are processing your customer data. Let us help! Rootroo offers consulting related to text normalization. We have a strong academic background in the state-of-the-art AI solutions for every NLP need. Just contact us, we won't bite.

Cite

Normalization (Finnish)

Niko Partanen, Mika Hämäläinen, and Khalid Alnajjar. (2019). Dialect Text Normalization to Normative Standard Finnish. In the Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT).

Normalization (Swedish)

Mika Hämäläinen, Niko Partanen and Khalid Alnajjar. (2020). Normalization of Different Swedish Dialects Spoken in Finland. In the Proceedings of the 4th ACM SIGSPATIAL Workshop on Geospatial Humanities.

Dialect generation

Mika Hämäläinen, Niko Partanen, Khalid Alnajjar, Jack Rueter & Thierry Poibeau (2020). Automatic Dialect Adaptation in Finnish and its Effect on Perceived Creativity. In Proceedings of the 11th International Conference on Computational Creativity. p. 204-211

Historical Finnish

Mika Hämäläinen, Niko Partanen and Khalid Alnajjar. (2021). Lemmatization of Historical Old Literary Finnish Texts in Modern Orthography. In Actes de la Conférence sur le Traitement Automatique des Langues Naturelles (TALN).

Data

The data used in the paper describing dialect generation has been published on Zenodo DOI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

murre-1.4.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

murre-1.4.0-py2.py3-none-any.whl (11.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file murre-1.4.0.tar.gz.

File metadata

  • Download URL: murre-1.4.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for murre-1.4.0.tar.gz
Algorithm Hash digest
SHA256 722615b230e3561f094771fcaf3c11c9dc5aacb10689258c65b977e7a02348f1
MD5 13d5f83f9dccf626b694f2c39407118c
BLAKE2b-256 abc2b0c7454fc7ebeaf4a493e730c0a37c0b62a04b287ef14554180a1d0eeee4

See more details on using hashes here.

File details

Details for the file murre-1.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: murre-1.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for murre-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 116792883f8550fd780ede7a4e4fd0727d6e2b83b1e4406dee0d496abeb36dd6
MD5 48456c9c0ca408061ca59faf8a790ba8
BLAKE2b-256 73505e74e07138b3975543f70af85cd121c978daa833f44193edce6ad2101c23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page