Skip to main content

NL normalization, intent detection, and entity extraction for nlp2cmd

Project description

nlp2cmd-intent

NL → IntentIR: normalizacja, detekcja intencji, encje.

Kanoniczna implementacja KeywordIntentDetector — nlp2cmd re-eksportuje ją z nlp2cmd.generation.keywords.

Użycie

from nlp2cmd_intent import IntentPipeline, analyze_query, ensure_intent_clear

intent = IntentPipeline().run("znajdź pliki *.py w src")
print(intent.intent, intent.target_kind, intent.confidence)

if intent.needs_clarification():
    # confidence < 0.5 lub niepuste ambiguities
    ...

ensure_intent_clear(intent, enforced=True)  # raises IntentClarificationRequired

structure = analyze_query("znajdź pliki *.py w src", include_plan=True)

Egzekwowanie clarification

flowchart LR
    IR[IntentIR] --> NC{needs_clarification?}
    NC -->|plan — zawsze| BLOCK[IntentClarificationRequired]
    NC -->|show — opcjonalnie| ENV{NLP2CMD_ENFORCE_CLARIFICATION=1}
    ENV -->|tak| BLOCK
    ENV -->|nie| OK[kontynuuj]
Ścieżka Zachowanie
nlp2cmd plan zawsze blokuje przy niskiej pewności
nlp2dsl show tylko z NLP2CMD_ENFORCE_CLARIFICATION=1

Kontrakty Intract (plan steps) — w nlp2cmd, nie w tym pakiecie. Zob. docs/intract-integration.md.

CLI (przez nlp2dsl-show)

nlp2dsl show "znajdź pliki *.py w src"

Instalacja

pip install -e packages/pact-ir
pip install -e packages/nlp2cmd-intent

Pliki danych

Bundlowane w src/nlp2cmd_intent/data/:

  • patterns.json
  • keyword_intent_detector_config.json

Override: NLP2CMD_PATTERNS_FILE, NLP2CMD_DETECTOR_CONFIG_FILE, NLP2CMD_CONFIG_DIR.

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

nlp2cmd_intent-0.1.1.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nlp2cmd_intent-0.1.1-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file nlp2cmd_intent-0.1.1.tar.gz.

File metadata

  • Download URL: nlp2cmd_intent-0.1.1.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for nlp2cmd_intent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a05b395a413f19798420a6952b90979ce52a7cbb3089218743c7e3d051ee7f04
MD5 dd7c72282f58901a900a43f4b70bc046
BLAKE2b-256 db556ec24a8b7e71a23e0981a981fc970d710d49095063b379214ccb6a49c182

See more details on using hashes here.

File details

Details for the file nlp2cmd_intent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nlp2cmd_intent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for nlp2cmd_intent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95fa5b09d72794d515a15ee2bcc503493180bd8428d4f9f8bafb5695856ea656
MD5 eeb0a0983d3c7fa9c8a5017f0f90260f
BLAKE2b-256 b521dae9fbb460830cfebe5cbfa45faddfd3478615768549c42341d9afb8bf8c

See more details on using hashes here.

Supported by

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