hyrinmansoor's picture
Upload T5ForConditionalGeneration
db3c85f verified
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'])