|
|
--- |
|
|
license: apache-2.0 |
|
|
task_categories: |
|
|
- question-answering |
|
|
- text-generation |
|
|
language: |
|
|
- en |
|
|
tags: |
|
|
- mental-health |
|
|
- counseling |
|
|
- conversations |
|
|
pretty_name: Mental Health Counseling Conversational Dataset |
|
|
size_categories: |
|
|
- 1K<n<10K |
|
|
--- |
|
|
|
|
|
# Mental Health Counseling Conversations (Cleaned) |
|
|
|
|
|
## Dataset Overview |
|
|
|
|
|
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. |
|
|
|
|
|
In this version, **duplicate Context-Response pairs** have been removed to improve data quality and usability. |
|
|
|
|
|
## Dataset Details |
|
|
|
|
|
- **Dataset Name**: [arafatanam/Mental-Health-Counseling](https://huggingface.co/datasets/arafatanam/Mental-Health-Counseling) |
|
|
- **Source Dataset**: [Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations) |
|
|
- **Modifications**: Removed redundant columns and duplicate Context-Response pairs |
|
|
- **Format**: JSON (newline-delimited) |
|
|
|
|
|
## Processing Steps |
|
|
|
|
|
The dataset was prepared using the following steps: |
|
|
|
|
|
1. Loaded the original dataset using the `datasets` library. |
|
|
2. Identified and removed duplicate columns. |
|
|
3. Dropped duplicate Context-Response pairs. |
|
|
4. Computed statistics on response counts per prompt. |
|
|
5. Saved the cleaned dataset as a JSON file. |
|
|
|
|
|
## Code Used for Cleaning |
|
|
|
|
|
```python |
|
|
# Install necessary libraries |
|
|
!pip install datasets |
|
|
|
|
|
# Import required modules |
|
|
from datasets import load_dataset |
|
|
import pandas as pd |
|
|
|
|
|
# Load dataset from Hugging Face |
|
|
dataset = load_dataset("Amod/mental_health_counseling_conversations") |
|
|
|
|
|
# Convert the dataset to a Pandas DataFrame (train split) |
|
|
df = pd.DataFrame(dataset['train']) |
|
|
|
|
|
# Remove duplicate Context-Response pairs |
|
|
df_cleaned = df.drop_duplicates(subset=['Context', 'Response']) |
|
|
|
|
|
# Calculate response count per prompt |
|
|
response_counts = df_cleaned.groupby('Context').size().reset_index(name='response_count') |
|
|
|
|
|
# Compute statistical insights |
|
|
min_responses = response_counts['response_count'].min() |
|
|
avg_responses = response_counts['response_count'].mean() |
|
|
max_responses = response_counts['response_count'].max() |
|
|
|
|
|
print(f"Minimum responses per prompt: {min_responses}") |
|
|
print(f"Average responses per prompt: {avg_responses:.2f}") |
|
|
print(f"Maximum responses per prompt: {max_responses}") |
|
|
|
|
|
# Identify prompts with the highest and lowest number of responses |
|
|
max_prompt = response_counts[response_counts['response_count'] == max_responses]['Context'].tolist() |
|
|
min_prompt = response_counts[response_counts['response_count'] == min_responses]['Context'].tolist() |
|
|
|
|
|
print(f"Prompt(s) with the highest responses ({max_responses}): {max_prompt}") |
|
|
print(f"Prompt(s) with the lowest responses ({min_responses}): {min_prompt}") |
|
|
|
|
|
# Calculate dataset reduction percentage |
|
|
reduction = ((df.shape[0] - df_cleaned.shape[0]) / df.shape[0]) * 100 |
|
|
|
|
|
print(f"Original dataset shape: {df.shape}") |
|
|
print(f"Cleaned dataset shape: {df_cleaned.shape}") |
|
|
print(f"Percentage reduction in data: {reduction:.2f}%") |
|
|
|
|
|
# Save cleaned dataset |
|
|
df_cleaned.to_json('mental-health-counseling.json', orient='records', lines=True) |
|
|
``` |
|
|
|
|
|
## Usage |
|
|
|
|
|
This dataset can be used for: |
|
|
|
|
|
- **Mental Health Chatbots**: Developing AI-driven support systems. |
|
|
- **Sentiment Analysis**: Analyzing emotional tones in counseling dialogues. |
|
|
- **Natural Language Processing (NLP)**: Training models for mental health-related text understanding. |
|
|
|
|
|
## License |
|
|
|
|
|
This dataset is released under the **Apache 2.0 License**. |
|
|
Please ensure compliance with licensing terms, especially regarding modifications and redistribution. |
|
|
For more details, refer to the [original dataset's license](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations). |
|
|
|
|
|
## Acknowledgments |
|
|
|
|
|
Special thanks to the creators of **Amod/mental_health_counseling_conversations** for providing the original dataset. |
|
|
|
|
|
--- |