Update customer-support-cleaned: cleaned dataset + dataset card
Browse files- README.md +137 -0
- dataset.jsonl +4 -0
README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
- es
|
| 7 |
+
tags:
|
| 8 |
+
- customer-support
|
| 9 |
+
- multilingual
|
| 10 |
+
- sentiment-analysis
|
| 11 |
+
- conversational
|
| 12 |
+
pretty_name: Customer Support Cleaned
|
| 13 |
+
size_categories:
|
| 14 |
+
- n<1K
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Customer Support Cleaned
|
| 18 |
+
|
| 19 |
+
## Dataset Summary
|
| 20 |
+
|
| 21 |
+
`customer-support-cleaned` is a small, curated multilingual customer-support
|
| 22 |
+
conversation dataset derived from a raw Excel workbook (`file1.xlsx`). Each
|
| 23 |
+
record contains a customer message (`user_message`), the support agent's reply
|
| 24 |
+
(`agent_response`), the conversation language (normalized to ISO 639-1), and a
|
| 25 |
+
sentiment label (`positive`, `neutral`, or `negative`).
|
| 26 |
+
|
| 27 |
+
The dataset is intended for tasks such as:
|
| 28 |
+
- Multilingual intent/sentiment classification for customer support,
|
| 29 |
+
- Evaluation of response-generation models,
|
| 30 |
+
- Demonstrations of data-cleaning and ETL pipelines.
|
| 31 |
+
|
| 32 |
+
The raw source contains intentionally noisy records (missing values, duplicate
|
| 33 |
+
IDs, inconsistent language codes, mixed-case sentiment labels, and duplicated
|
| 34 |
+
message pairs). All noise is removed by a reproducible cleaning pipeline (see
|
| 35 |
+
[Cleaning Decisions](#cleaning-decisions)), and the resulting artifact is
|
| 36 |
+
published as JSON Lines.
|
| 37 |
+
|
| 38 |
+
## Language Coverage
|
| 39 |
+
|
| 40 |
+
Language values are normalized to ISO 639-1 codes. Coverage in the released
|
| 41 |
+
version:
|
| 42 |
+
|
| 43 |
+
| Language | ISO 639-1 code | Count |
|
| 44 |
+
|---------------|----------------|-------|
|
| 45 |
+
| English | `en` | 1 |
|
| 46 |
+
| Chinese | `zh` | 2 |
|
| 47 |
+
| Spanish | `es` | 1 |
|
| 48 |
+
| **Total** | | **4** |
|
| 49 |
+
|
| 50 |
+
## Data Fields
|
| 51 |
+
|
| 52 |
+
Each row in `dataset.jsonl` is a JSON object with the following fields (in
|
| 53 |
+
order):
|
| 54 |
+
|
| 55 |
+
| Field | Type | Description |
|
| 56 |
+
|-------------------|---------|--------------------------------------------------------------------------|
|
| 57 |
+
| `id` | int | Unique identifier of the conversation record. |
|
| 58 |
+
| `timestamp` | string | Timestamp of the customer message (`YYYY-MM-DD HH:MM:SS`). |
|
| 59 |
+
| `user_message` | string | Customer's message (trimmed). |
|
| 60 |
+
| `agent_response` | string | Agent's reply (trimmed). |
|
| 61 |
+
| `language` | string | ISO 639-1 language code of the conversation (e.g. `en`, `zh`, `es`). |
|
| 62 |
+
| `sentiment` | string | Lowercase sentiment label: `positive`, `neutral`, or `negative`. |
|
| 63 |
+
| `message_length` | int | Number of characters in `user_message`. |
|
| 64 |
+
|
| 65 |
+
### Example
|
| 66 |
+
|
| 67 |
+
```json
|
| 68 |
+
{"id": 1, "timestamp": "2024-01-01 10:00:00", "user_message": "How do I reset my password?", "agent_response": "Please click the reset link on the login page.", "language": "en", "sentiment": "neutral", "message_length": 27}
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Cleaning Decisions
|
| 72 |
+
|
| 73 |
+
The raw workbook contained 8 records. The following deterministic pipeline
|
| 74 |
+
(`clean_dataset.py`) was applied, in order:
|
| 75 |
+
|
| 76 |
+
1. **Remove incomplete rows** – Rows where `user_message` or `agent_response`
|
| 77 |
+
is missing (NaN) or blank (empty / whitespace-only) are dropped
|
| 78 |
+
(2 rows removed).
|
| 79 |
+
2. **Trim whitespace** – Leading/trailing whitespace is removed from all text
|
| 80 |
+
fields (`timestamp`, `user_message`, `agent_response`, `language`,
|
| 81 |
+
`sentiment`).
|
| 82 |
+
3. **Deduplicate message pairs** – Rows with identical `user_message` and
|
| 83 |
+
`agent_response` (after trimming) are dropped, keeping the first occurrence
|
| 84 |
+
(2 rows removed).
|
| 85 |
+
4. **Enforce unique IDs** – Any remaining duplicate `id` values are resolved by
|
| 86 |
+
keeping the first occurrence; the number of duplicates removed is recorded
|
| 87 |
+
(0 rows removed after step 3).
|
| 88 |
+
5. **Normalize language** – Language values are mapped to ISO 639-1 codes
|
| 89 |
+
(`English` → `en`, `Chinese` → `zh`, `Spanish` → `es`; already-normalized
|
| 90 |
+
codes such as `zh` are kept as-is).
|
| 91 |
+
6. **Normalize sentiment** – Sentiment labels are lowercased (`Neutral` →
|
| 92 |
+
`neutral`, `Positive ` → `positive`) and only rows with sentiment in
|
| 93 |
+
{`positive`, `neutral`, `negative`} are retained (labels such as `angry`
|
| 94 |
+
are dropped; 0 rows removed in this step because the `angry` row was
|
| 95 |
+
already removed as incomplete).
|
| 96 |
+
7. **Add `message_length`** – An integer column is computed as the character
|
| 97 |
+
count of the trimmed `user_message`.
|
| 98 |
+
|
| 99 |
+
**Result:** 8 raw records → **4 cleaned records**.
|
| 100 |
+
|
| 101 |
+
The full cleaning report (counts per step) is printed by `clean_dataset.py` and
|
| 102 |
+
is reproduced here for traceability:
|
| 103 |
+
|
| 104 |
+
```
|
| 105 |
+
original_rows: 8
|
| 106 |
+
rows_removed_missing_or_blank: 2
|
| 107 |
+
rows_removed_duplicate_message_pairs: 2
|
| 108 |
+
rows_removed_duplicate_ids: 0
|
| 109 |
+
rows_removed_invalid_sentiment: 0
|
| 110 |
+
final_rows: 4
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
## Reproducibility
|
| 114 |
+
|
| 115 |
+
To rebuild the dataset from the raw source:
|
| 116 |
+
|
| 117 |
+
```bash
|
| 118 |
+
pip install pandas openpyxl
|
| 119 |
+
python clean_dataset.py file1.xlsx dataset.jsonl
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
## Licensing and Usage Notes
|
| 123 |
+
|
| 124 |
+
- **License:** This dataset is released under the
|
| 125 |
+
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license. You are
|
| 126 |
+
free to share and adapt the material with appropriate attribution.
|
| 127 |
+
- **Usage:** Suitable for research and educational purposes, including
|
| 128 |
+
multilingual NLP, sentiment analysis, and customer-support modeling. It is a
|
| 129 |
+
small demo/quality-controlled dataset and should not be treated as a
|
| 130 |
+
representative benchmark for production systems.
|
| 131 |
+
- **Privacy:** All messages are synthetic/sample content; no personal or
|
| 132 |
+
identifying information is included.
|
| 133 |
+
- **Bias & limitations:** Due to the very small size (4 records), the dataset
|
| 134 |
+
does not claim statistical representativeness. Language and sentiment
|
| 135 |
+
distributions reflect only the cleaned sample.
|
| 136 |
+
- **Maintenance:** If the upstream raw data changes, re-run `clean_dataset.py`
|
| 137 |
+
and re-upload `dataset.jsonl` to refresh this repository.
|
dataset.jsonl
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": 1, "timestamp": "2024-01-01 10:00:00", "user_message": "How do I reset my password?", "agent_response": "Please click the reset link on the login page.", "language": "en", "sentiment": "neutral", "message_length": 27}
|
| 2 |
+
{"id": 2, "timestamp": "2024-01-01 10:05:00", "user_message": "我的订单还没有发货", "agent_response": "我们会为您检查物流状态。", "language": "zh", "sentiment": "negative", "message_length": 9}
|
| 3 |
+
{"id": 5, "timestamp": "2024-01-01 10:15:00", "user_message": "Gracias por la ayuda", "agent_response": "De nada.", "language": "es", "sentiment": "positive", "message_length": 20}
|
| 4 |
+
{"id": 6, "timestamp": "2024-01-01 10:20:00", "user_message": "退款申请", "agent_response": "我们已经处理您的退款。", "language": "zh", "sentiment": "negative", "message_length": 4}
|