Skip to main content

How to Optimize the Accuracy of AskTable

Improving the accuracy of AskTable can be achieved through three main approaches: data governance, providing high-quality training data, and setting personalized preferences.

1. Optimize Data Structure to Enhance Data Quality

To make AskTable understand and query data more accurately, it is essential to optimize the database table structure and field definitions.

  • Streamline Data Tables: Retain only necessary tables and eliminate redundant data.

    Support Select Table
  • Filter Key Fields: Hide unnecessary fields to ensure queries are focused.

    Field Visibility
  • Enable AI Search: For fields like names, locations, company names, and product names, it is recommended to enable AI search by default to improve query accuracy.

    Field AI Search
  • Define Enumerated Values: Fields such as gender and status should have clear and complete definitions. For example, sex=1 indicates "male," and sex=2 indicates "female."

    Field Enumerated Values
  • Label Field Units: Clearly define the units for fields; for instance, specify whether an amount field is in "cents" or "yuan."

    Field Units
  • Describe Foreign Key Relationships: Clearly explain which primary key in another table a foreign key field relates to, avoiding misunderstandings.

    Field Foreign Key
  • Provide Scene Descriptions: In table definitions, describe the business scenarios where the table applies to help AI understand how the data is used.

  • Control the Number of Tables:

    • No more than 100 tables per robot.
    • No more than 5 tables for JOIN queries to reduce query complexity.
  • Control the Number of Fields:

    • No more than 100 fields per table to avoid overly long contexts and potential AI reasoning failures.

2. Provide High-Quality Training Data to Enhance AI Understanding

AskTable can continuously optimize query results and learn how to answer user questions more accurately through training data.

  • Mark Correct Answers: Use the "like" function for expected query results to help AskTable remember the best answers.

    User Feedback
  • Manually Add Training Data: Pre-enter typical questions and their corresponding SQL statements to help AI recognize complex query logic.

    Training Data
  • Solidify Complex Query Logic: For complex queries involving multiple table joins or calculations, use training data to solidify best practices to ensure AI generates high-quality SQL.

3. Set Personalized Preferences to Align AI with Business Needs

By setting query preferences, AskTable can better align its responses with business habits.

  • Adjust Data Display Methods:

    • For example, phone numbers can be displayed with the middle four digits hidden (e.g., 138****5678).
  • Customize Query Return Fields:

    • For example, when querying user information, set the default return fields to ID and phone number, rather than all fields.
  • Set Default Query Time Range:

    • For example, if no time range is specified, default to querying data from the last 30 days.
    Query Preference

Through these optimization measures, AskTable can better understand user intentions, improve the precision of query results, and thus better support business decision-making.