source_datasets:Amod/mental_health_counseling_conversations license:openrail size_categories:1K<n<10K format:csv modality:text library:datasets library:pandas library:mlcroissant library:polars region:us
---
license: openrail
source_datasets:
  - Amod/mental_health_counseling_conversations
---

Conversion of [Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations) dataset to be used in pretraining.

Python code used for conversion:

```python
from datasets import load_dataset
import pandas
import re

dataset = load_dataset("Amod/mental_health_counseling_conversations", split="train")

def format(columns):
    return re.sub(r'\s+', ' ', columns["Response"]).strip()

text = [format(columns) for columns in dataset]

pandas.DataFrame({"text": list(filter(None, text))}).to_csv("train.csv", index=False)
```
