← Valitut työt← Selected work
Kieliteknologia · rajapinta Language technology · API

Taivutus
API

Lähetät sanan. Ensin deterministinen moottori tunnistaa sen perusmuodon ja taivutusluokan, sitten avoin suomalainen kielimalli kirjoittaa esimerkkilauseen juuri sille muodolle. Kaksi vaihetta, yksi kutsu.

You send a word. First a deterministic engine resolves its base form and inflection class, then an open Finnish language model writes an example sentence for that exact form. Two stages, one call.

Kehitteillä · varhainen pääsy avoinna In development · early access open
[ 01 ]

Kaksi vaihetta

Two stages

01

Moottori: perusmuoto

Engine: base form

Sana tulee sisään missä taivutusmuodossa tahansa. Moottori palauttaa perusmuodon ja taivutusluokan Kotuksen luokituksen pohjalta sekä koko paradigman. Tämä osa on deterministinen: se on sääntöjen tulos, ei mallin arvaus.

The word arrives in any inflected form. The engine returns the base form and the inflection class from the Kotus classification, along with the full paradigm. This part is deterministic: it is the output of rules, not a model's guess.

02

Malli: esimerkkilause

Model: example sentence

Tunnistetulle muodolle kirjoitetaan esimerkkilause avoimella suomalaisella kielimallilla (Llama-Poro-2-70B), joka ajetaan omalla GPU-kapasiteetilla vLLM:llä. Lause rakennetaan sen muodon ympärille, jonka käyttäjä lähetti, ei sanan perusmuodon.

For the resolved form, an example sentence is written by an open Finnish language model (Llama-Poro-2-70B) running on dedicated GPU capacity with vLLM. The sentence is built around the form the caller sent, not around the base form.

[ 02 ]

Rajapinnan luonnos

API sketch

POST /v1/analyze
{ "word": "taloissa" }

→
{
  "word":     "taloissa",
  "lemma":    "talo",
  "class":    1,
  "form":     "monikon inessiivi",
  "sentence": "Naapurin taloissa paloi valo koko yön."
}

Muoto ei ole lukittu: rajapinta on vielä kehitteillä ja ensimmäiset käyttäjät saavat vaikuttaa siihen.

The shape is not locked: the API is still in development and the first users get to shape it.

[ 03 ]

Miksi näin

Why it is built this way

Pelkkä kielimalli osaa kirjoittaa lauseen, mutta ei takaa että lauseessa esiintyy juuri se muoto jota pyysit. Siksi taivutus ei ole mallin vastuulla lainkaan: muodot tulevat säännöistä, malli kirjoittaa vain lauseen.

A language model on its own can write a sentence, but it cannot guarantee that the sentence contains the exact form you asked for. So inflection is not the model's job at all: the forms come from rules, the model only writes the sentence.

Mallin ulostulon ja vastauksen välissä on portit. Ne hylkäävät lauseen mekaanisesti, jos kohdemuoto ei esiinny siinä, jos pituus tai rekisteri ei kelpaa tai jos rakenne on mahdoton.

Between the model output and the response there are gates. They reject a sentence mechanically if the target form does not appear in it, if length or register is off, or if the structure is impossible.

Jokainen promptimuutos ajetaan A/B-koesarjana: päätössääntö kirjataan ennen ajoa ja tulosta verrataan käsin merkittyyn ankkurijoukkoon, ei vaikutelmaan siitä, miltä otos näytti. Moni lupaavalta kuulostanut idea on kaatunut siihen mittaukseen ja peruttu. Tyhjä vastaus on parempi kuin väärä lause.

Every prompt change is run as an A/B series: the decision rule is written down before the run and the result compared against a hand-labelled anchor set, not against an impression of how the samples looked. Several promising-sounding ideas have died in that measurement and been rolled back. An empty response beats a wrong sentence.

[ 04 ]

Kenelle

Who it is for

Kielenoppimissovellukset, sanakirjat ja sisällöntuotanto, joissa suomen taivutus pitää saada oikein ja jokainen muoto halutaan näyttää käytössä eikä taulukossa.

Language-learning apps, dictionaries and content tooling where Finnish inflection has to be right, and where every form should be shown in use rather than in a table.

Rajapinta on syntynyt oikeasta tarpeesta: se on sama koneisto, joka tuottaa Picamoi-sovelluksen esimerkkilauseet.

The API grew out of a real need: it is the same machinery that produces the example sentences in the Picamoi app.

Teknologiat
Stack
PythonModalvLLMLlama-Poro-2 PostgreSQLTypeScript

Built with Llama. Llama 3.3 is licensed under the Llama 3.3 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.

Varhainen pääsy

Early access

Rajapinta on kehitteillä. Jos se sopisi siihen mitä olet rakentamassa, kerro käyttötapauksesi. Ensimmäiset käyttäjät pääsevät mukaan ennen julkaisua ja vaikuttavat siihen mitä rajapinta palauttaa.

The API is in development. If it would fit what you are building, tell me your use case. The first users get in before launch and shape what the API returns.