metadata
tags:
- flan-t5-base
- transformers
- erpnext
- query-generation
- frappe
- text2frappe
- text2text-generation
pipeline_tag: text2text-generation
license: apache-2.0
language: en
library_name: transformers
model-index:
- name: Text2Frappe - Stage 3 Query Generator
results: []
π§ Text2Frappe - Stage 3 Query Generator (FLAN-T5-BASE)
This model is the third stage in the Text2Frappe pipeline, which enables natural language interface to ERPNext by converting questions into executable database queries.
π― Task
Text2Text Generation β Prompt-based query formulation.
Given:
- A detected ERPNext Doctype (from Stage 1),
- A natural language question,
- A list of selected relevant fields (from Stage 2),
this model generates a valid Frappe ORM-style query (e.g., frappe.get_all(...)
) to retrieve the required data.
π§© Input Format
Inputs are JSON-style strings containing:
doctype
: the ERPNext document type.question
: the user's question in natural language.fields
: a list of relevant field names predicted by Stage 2.
π₯ Example Input
{
"doctype": "Purchase Invoice Advance",
"question": "List the reference types used in advance payments made this month.",
"fields": ["reference_type"]
}
π€ Example Output
frappe.get_all('Purchase Invoice Advance', filters={'posting_date': ['between', ['2024-04-01', '2024-04-30']]}, fields=['reference_type'])