Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- question-answering
|
| 5 |
+
- text-generation
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- mental-health
|
| 10 |
+
- counseling
|
| 11 |
+
- conversations
|
| 12 |
+
pretty_name: Mental Health Counseling Conversational Dataset
|
| 13 |
+
size_categories:
|
| 14 |
+
- 1K<n<10K
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Mental Health Counseling Conversations (Cleaned)
|
| 18 |
+
|
| 19 |
+
## Dataset Overview
|
| 20 |
+
|
| 21 |
+
This dataset is derived from the original **[Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations)** dataset, which contains mental health counseling conversations.
|
| 22 |
+
|
| 23 |
+
In this version, **duplicate Context-Response pairs** have been removed to improve data quality and usability.
|
| 24 |
+
|
| 25 |
+
## Dataset Details
|
| 26 |
+
|
| 27 |
+
- **Dataset Name**: [arafatanam/Mental-Health-Counseling](https://huggingface.co/datasets/arafatanam/Mental-Health-Counseling)
|
| 28 |
+
- **Source Dataset**: [Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations)
|
| 29 |
+
- **Modifications**: Removed redundant columns and duplicate Context-Response pairs
|
| 30 |
+
- **Format**: JSON (newline-delimited)
|
| 31 |
+
|
| 32 |
+
## Processing Steps
|
| 33 |
+
|
| 34 |
+
The dataset was prepared using the following steps:
|
| 35 |
+
|
| 36 |
+
1. Loaded the original dataset using the `datasets` library.
|
| 37 |
+
2. Identified and removed duplicate columns.
|
| 38 |
+
3. Dropped duplicate Context-Response pairs.
|
| 39 |
+
4. Computed statistics on response counts per prompt.
|
| 40 |
+
5. Saved the cleaned dataset as a JSON file.
|
| 41 |
+
|
| 42 |
+
## Code Used for Cleaning
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
# Install necessary libraries
|
| 46 |
+
!pip install datasets
|
| 47 |
+
|
| 48 |
+
# Import required modules
|
| 49 |
+
from datasets import load_dataset
|
| 50 |
+
import pandas as pd
|
| 51 |
+
|
| 52 |
+
# Load dataset from Hugging Face
|
| 53 |
+
dataset = load_dataset("Amod/mental_health_counseling_conversations")
|
| 54 |
+
|
| 55 |
+
# Convert the dataset to a Pandas DataFrame (train split)
|
| 56 |
+
df = pd.DataFrame(dataset['train'])
|
| 57 |
+
|
| 58 |
+
# Remove duplicate Context-Response pairs
|
| 59 |
+
df_cleaned = df.drop_duplicates(subset=['Context', 'Response'])
|
| 60 |
+
|
| 61 |
+
# Calculate response count per prompt
|
| 62 |
+
response_counts = df_cleaned.groupby('Context').size().reset_index(name='response_count')
|
| 63 |
+
|
| 64 |
+
# Compute statistical insights
|
| 65 |
+
min_responses = response_counts['response_count'].min()
|
| 66 |
+
avg_responses = response_counts['response_count'].mean()
|
| 67 |
+
max_responses = response_counts['response_count'].max()
|
| 68 |
+
|
| 69 |
+
print(f"Minimum responses per prompt: {min_responses}")
|
| 70 |
+
print(f"Average responses per prompt: {avg_responses:.2f}")
|
| 71 |
+
print(f"Maximum responses per prompt: {max_responses}")
|
| 72 |
+
|
| 73 |
+
# Identify prompts with the highest and lowest number of responses
|
| 74 |
+
max_prompt = response_counts[response_counts['response_count'] == max_responses]['Context'].tolist()
|
| 75 |
+
min_prompt = response_counts[response_counts['response_count'] == min_responses]['Context'].tolist()
|
| 76 |
+
|
| 77 |
+
print(f"Prompt(s) with the highest responses ({max_responses}): {max_prompt}")
|
| 78 |
+
print(f"Prompt(s) with the lowest responses ({min_responses}): {min_prompt}")
|
| 79 |
+
|
| 80 |
+
# Calculate dataset reduction percentage
|
| 81 |
+
reduction = ((df.shape[0] - df_cleaned.shape[0]) / df.shape[0]) * 100
|
| 82 |
+
|
| 83 |
+
print(f"Original dataset shape: {df.shape}")
|
| 84 |
+
print(f"Cleaned dataset shape: {df_cleaned.shape}")
|
| 85 |
+
print(f"Percentage reduction in data: {reduction:.2f}%")
|
| 86 |
+
|
| 87 |
+
# Save cleaned dataset
|
| 88 |
+
df_cleaned.to_json('mental-health-counseling.json', orient='records', lines=True)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## Usage
|
| 92 |
+
|
| 93 |
+
This dataset can be used for:
|
| 94 |
+
|
| 95 |
+
- **Mental Health Chatbots**: Developing AI-driven support systems.
|
| 96 |
+
- **Sentiment Analysis**: Analyzing emotional tones in counseling dialogues.
|
| 97 |
+
- **Natural Language Processing (NLP)**: Training models for mental health-related text understanding.
|
| 98 |
+
|
| 99 |
+
## License
|
| 100 |
+
|
| 101 |
+
This dataset is released under the **Apache 2.0 License**.
|
| 102 |
+
Please ensure compliance with licensing terms, especially regarding modifications and redistribution.
|
| 103 |
+
For more details, refer to the [original dataset's license](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations).
|
| 104 |
+
|
| 105 |
+
## Acknowledgments
|
| 106 |
+
|
| 107 |
+
Special thanks to the creators of **Amod/mental_health_counseling_conversations** for providing the original dataset.
|
| 108 |
+
|
| 109 |
+
---
|