Skip to main content

pyfrspell

English | 中文 | Francais

pyfrspell is a Python package for French lemma prediction and derivative form generation. It supports:

  • conjugation to lemma prediction
  • noun form generation
  • adjective form generation
  • verb form generation

The package runs with ONNX Runtime and quantized INT8 models for high speed and small model footprint.

Install

pip install pyfrspell

Integrate Into Your Project

from pyfrspell import FrSpell

predictor = FrSpell()

lemma = predictor.lemma("mangeons")
noun = predictor.noun_derive("chat", "THD_PLF")
adje = predictor.adje_derive("beau", "THD_F")
verb = predictor.verb_derive("manger", "FST_PL", "INDI", "PRES")

print(lemma)
print(noun)
print(adje)
print(verb)

Sample runtime output:

{'input': 'mangeons', 'lemma': 'manger', 'wordType': 'VERB', 'confidence': 0.9965, 'timeMs': 3.89}
{'lemma': 'chat', 'wordType': 'NOUN', 'person': 'THD_PLF', 'mode': 'ALL', 'tense': 'ALL', 'output': 'chattes', 'confidence': 0.9997, 'timeMs': 5.06}
{'lemma': 'beau', 'wordType': 'ADJE', 'person': 'THD_F', 'mode': 'ALL', 'tense': 'ALL', 'output': 'belle', 'confidence': 0.9999, 'timeMs': 3.08}
{'lemma': 'manger', 'wordType': 'VERB', 'person': 'FST_PL', 'mode': 'INDI', 'tense': 'PRES', 'output': 'mangeons', 'confidence': 0.9999, 'timeMs': 4.79}

Prediction Parameters

Lemma prediction:

  • API: predictor.lemma(input_word)
  • input_word: string, inflected or conjugated word form, for example mangeons

Derive prediction:

  • Noun API: predictor.noun_derive(lemma, person)
  • Adjective API: predictor.adje_derive(lemma, person)
  • Verb API: predictor.verb_derive(lemma, person, mode, tense)
  • Generic API: predictor.derive(lemma, word_type, person, mode, tense)

Allowed word_type values:

  • NOUN (noun)
  • ADJE (adjective)
  • VERB (verb)

Allowed person values:

  • FST (1st person singular)
  • SND (2nd person singular)
  • THD_M (3rd person masculine singular)
  • THD_F (3rd person feminine singular)
  • FST_PL (1st person plural)
  • SND_PL (2nd person plural)
  • THD_PLM (3rd person masculine plural)
  • THD_PLF (3rd person feminine plural)

Allowed mode values:

  • INDI (indicative)
  • SUBJ (subjunctive)
  • COND (conditional)
  • PART (participle)
  • IMPE (imperative)
  • INFI (infinitive)

Allowed tense values in current implementation:

  • PRES (present)
  • IMPA (imperfect)
  • FUTU (future)
  • PASS (past)

Note:

  • The original grammar definition includes more tense names, but this package currently supports only PRES, IMPA, FUTU, PASS.
  • For noun and adjective derive calls, mode and tense are not required in user input.

Run Test

python smoke_test.py --verbose

This runs a local smoke test to validate import, model loading, and core APIs.

Metadata

Release files for pyfrspell 0.1.1

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

Source distribution (sdist)

Source distribution for pyfrspell 0.1.1
File Size Uploaded
pyfrspell-0.1.1.tar.gz 2.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfrspell 0.1.1
File Interpreter ABI Platform
pyfrspell-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 MB

Release files / pyfrspell-0.1.1.tar.gz

Download URL pyfrspell-0.1.1.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
50e0ebb9a093160403f07ed001a45c472978ff68adca6df35db4a322d52af36d
BLAKE2b-256 checksum
How to use checksums
a68f4215f73cb0f9635b94d1980d950438577f25c1fb779fa373f38da5324982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / pyfrspell-0.1.1-py3-none-any.whl

Download URL pyfrspell-0.1.1-py3-none-any.whl
Size 2.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7dae6eb2fdb534bf6afe9500c1923dfc0491c3df511f922023a19ab702a278c8
BLAKE2b-256 checksum
How to use checksums
dade156f40f6d87047ea8017cdcb29c61d0117490ba9dca8d549b136f183e47f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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