AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Inspect Datasets and Generate Visual Trend Charts in Ernie Bot

365Finds Editorial
Indexed 11,430 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Business researchers and data analysts can inspect complex datasets and generate publication-ready visual trend charts in Ernie Bot (文心一言) by leveraging its built-in data analysis tools, sandbox Code Interpreter, and native E-Chart visualization components. Instead of manually constructing nested spreadsheet formulas, debugging pivot tables, or writing repetitive Python scripts in Pandas and Matplotlib, analysts can upload .xlsx or .csv files directly into Ernie Bot and use natural language instructions to profile data quality, run time-series aggregations, and render interactive trend charts.

This guide provides an end-to-end operational blueprint for data teams and business researchers, detailing the underlying execution model, step-by-step spreadsheet inspection workflows, prompt design patterns, enterprise trade-offs, and critical data governance boundaries.


1. How Ernie Bot Processes Spreadsheets

Traditional large language models generate text based on statistical probability, which makes them unreliable for direct mathematical calculations and numerical aggregations. Ernie Bot overcomes this limitation by coupling the foundational reasoning of the ERNIE model with an execution environment:

  1. Deterministic Sandbox Execution (Code Interpreter): When a spreadsheet is uploaded, Ernie Bot does not attempt to calculate sums or standard deviations purely within its language weights. Instead, it translates the user's analytical query into Python code (utilizing libraries such as pandas, numpy, and openpyxl), executes that code inside an isolated backend sandbox, and returns verified numerical outputs.
  2. Native Chart Generation via E-Chart Engine: For data visualization, Ernie Bot integrates visualization components built upon Apache ECharts (such as the native E-Chart / E言易图 plugin) and graphical rendering libraries. This allows the model to produce multi-dimensional visual assets—including line charts, stacked area charts, multi-axis bar graphs, and heatmaps—complete with interactive tooltips and customizable aesthetic parameters.
  3. Structured Ingestion & Metadata Mapping: Ernie Bot parses multi-sheet Excel workbooks and delimited text files, mapping column data types, identifying temporal indices, and flagging missing values before executing analytical queries.

2. Step-by-Step Workflow: From Spreadsheet Upload to Trend Chart

Step 1: Prepare and Upload the Dataset

Before uploading spreadsheets to Ernie Bot, ensure the tabular structure is optimized for programmatic parsing:

Upload the file via the attachment paperclip icon in the Ernie Bot interface or within a custom data agent workspace on Baidu Qianfan AppBuilder.

Step 2: Perform Initial Dataset Inspection (EDA)

Do not immediately request complex visualizations. Begin with an exploratory data inspection to verify how the model interprets columns and data types.

Sample Prompt:

"I have uploaded our quarterly sales spreadsheet. Please inspect the dataset: list all column names with their detected data types, report total row count, calculate the percentage of missing values per column, and display the first five rows in a summary table."

Expected Output: Ernie Bot generates and runs Python inspection scripts, returning:

Step 3: Clean and Filter Data via Natural Language

Once columns are verified, direct Ernie Bot to clean records and compute foundational metrics.

Sample Prompt:

"Please clean the dataset: filter out any records where Order_Status is 'Cancelled' or Net_Revenue is less than or equal to zero. Convert the Transaction_Date column into monthly periods (YYYY-MM), and compute the total monthly revenue, order count, and average order value (AOV)."

The model executes the filtering logic deterministically, ensuring subsequent trend visualizations reflect accurate, deduplicated transactional data.

Step 4: Generate Multi-Series Visual Trend Charts

Request specific visualization types, defining dimensions, metrics, and temporal granulations.

Sample Prompt:

"Generate a monthly visual trend chart displaying Net_Revenue from January to December across our three main regions ('North America', 'EMEA', 'APAC'). Use a line chart with smooth curves, distinct regional colors, formatted currency labels on the Y-axis, and marker points highlighting the peak month for each region. Provide a brief bullet-point summary of the observed trends below the chart."

What Happens Behind the Scenes: Ernie Bot generates the aggregation script, groups by [Year-Month, Region], extracts time-series coordinates, and invokes the visualization module (via E-Chart or Matplotlib). It renders an embedded chart showing:

Step 5: Drill Down and Refine Visual Attributes

Ernie Bot preserves conversational context, allowing iterative refinement of the generated visual without re-uploading the dataset.

Refinement Prompts:


3. High-Impact Prompt Templates for Analysts

Analytical GoalRecommended Prompt Structure
Data Sanity Check"Inspect the attached spreadsheet. Check for duplicate primary keys, null values in revenue fields, and report the minimum and maximum dates present."
Cohort & Segment Trend"Group users by Acquisition_Month and display a line chart tracking their 30-day retention rate over the last six quarters."
Outlier & Anomaly Detection"Calculate the interquartile range (IQR) for Daily_Transactions. Plot a time-series scatter chart highlighting transaction spikes and drops exceeding 2.5 standard deviations from the mean."
Comparative Growth Analysis"Calculate Month-over-Month (MoM) and Year-over-Year (YoY) revenue growth rates. Generate a dual-axis chart with monthly gross revenue as bars and MoM percentage growth as an overlay line."

4. Ernie Bot vs. Traditional BI and Alternative AI Tools

When deciding when to deploy Ernie Bot for data workflows, analysts should weigh its strengths against conventional BI suites and global LLM platforms:

Evaluation DimensionErnie Bot (Code Interpreter & E-Chart)Traditional BI (Power BI / Tableau)Raw LLMs without Code Execution
Setup & Modeling OverheadNear Zero: Immediate conversational analysis of ad-hoc spreadsheets.High: Requires semantic data models, relationship definitions, and DAX/LOD measures.Low: But prone to severe numerical hallucinations on calculations.
Calculation ReliabilityHigh: Code-executed in Python sandbox (pandas/numpy).Deterministic: Enterprise-grade formula engine.Unreliable: Statistical text prediction, frequent arithmetic errors.
Chinese Business SemanticsNative: Excels at domestic fiscal calendars, YoY/MoM terminology (同比/环比), and Chinese commercial formats.Manual: Requires custom localized naming and formatting configurations.Moderate: Often translates Chinese business nuances literally.
Interactive AgilityInstant: Ask new questions and morph visualizations in seconds.Rigid: New metrics often require data model schema updates.Fast: But cannot output downloadable, processed data files.

5. Security, Privacy, and Enterprise Deployment Boundaries

While Ernie Bot significantly accelerates ad-hoc exploratory data analysis, business researchers and compliance officers must establish appropriate data governance rules:

  1. Data Masking & PII Protection: Before uploading files to consumer-facing chat interfaces, strip sensitive personal identifiable information (PII)—such as customer national IDs, credit card numbers, and unhashed email addresses. Use synthetic identifiers (User_001, User_002) instead.
  2. Enterprise Isolation via Baidu Qianfan: For proprietary financial datasets or regulated corporate reporting, access Ernie models through Baidu Qianfan Model Platform (千帆大模型平台) and AppBuilder. This infrastructure provides enterprise VPC isolation, custom data retention policies, and private role-based access control (RBAC).
  3. Audit the Sandbox Code: Always expand the "View Code" or execution trace provided in Ernie Bot's response. Verify that the Python script applied the correct aggregation methods (e.g., checking whether null values were imputed with zero or dropped, and confirming time-zone alignments).
  4. Volume Boundaries: Ernie Bot's code interpreter is designed for ad-hoc datasets, departmental reporting sheets, and research cohorts (typically up to several hundred thousand rows). For multi-million-row enterprise warehouses, use standard data warehouse engines (SQL, ClickHouse, BigQuery) to aggregate summary tables before feeding data into Ernie Bot for automated visual interpretation.

References