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:
- 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, andopenpyxl), executes that code inside an isolated backend sandbox, and returns verified numerical outputs. - 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.
- 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:
- Single Header Row: Ensure the first row contains distinct, descriptive column headers (e.g.,
Transaction_Date,Region,Product_Category,Net_Revenue_USD,Active_Users). - Tabular Continuity: Remove merged cells across data records, blank placeholder rows, and decorative formatting (such as subtotal rows embedded within the raw records).
- Supported Formats: Save files as standard
.xlsxor.csv. Keep individual file uploads within typical operational limits (generally under 50 MB for interactive web sessions).
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:
- A structural overview of dimensions (e.g., 25,400 rows × 12 columns).
- Identified temporal columns (e.g., ISO dates parsed as datetime objects).
- Data hygiene warnings (e.g., null values detected in
Discount_Rateor inconsistent string entries in categorical fields).
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_Statusis 'Cancelled' orNet_Revenueis less than or equal to zero. Convert theTransaction_Datecolumn 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_Revenuefrom 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:
- Trajectories across regions over time.
- Seasonal inflection points (e.g., summer dips or Q4 holiday surges).
- Clear legend and axis formatting.
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:
- Switch Chart Type: "Convert this line chart into a 100% stacked area chart to illustrate how the regional revenue share evolved over the twelve months."
- Add Statistical Context: "Add a 3-month moving average trendline to the overall revenue curve to smooth out month-to-month volatility."
- Export Cleaned Tables: "Export the monthly regional aggregation table as a downloadable
.xlsxfile."
3. High-Impact Prompt Templates for Analysts
| Analytical Goal | Recommended 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 Dimension | Ernie Bot (Code Interpreter & E-Chart) | Traditional BI (Power BI / Tableau) | Raw LLMs without Code Execution |
|---|---|---|---|
| Setup & Modeling Overhead | Near 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 Reliability | High: Code-executed in Python sandbox (pandas/numpy). | Deterministic: Enterprise-grade formula engine. | Unreliable: Statistical text prediction, frequent arithmetic errors. |
| Chinese Business Semantics | Native: 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 Agility | Instant: 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:
- 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. - 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).
- 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).
- 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.