Datasets:

Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Libraries:
Datasets
Dask
License:
File size: 2,013 Bytes
4520898
 
ccee02d
 
 
 
4520898
 
d4fa151
 
 
ccee02d
d4fa151
ccee02d
d4fa151
ccee02d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4520898
cccfa19
 
 
d4fa151
 
 
0fef5e7
d4fa151
 
 
ccee02d
d4fa151
 
 
cccfa19
0fef5e7
cccfa19
 
d4fa151
cccfa19
 
 
d4fa151
 
 
 
 
0fef5e7
d4fa151
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
license: cc-by-4.0
language: en
pretty_name: Primock-57
size_categories:
  - n<100
---

# Primock-57

This is a version of the [Primock-57](https://github.com/babylonhealth/primock57) dataset converted to the [`sdialog`](https://github.com/idiap/sdialog) `Dialog` JSON format.  
It allows easy loading as dialog objects via `Dialog.from_file()` or `Dialog.from_huggingface`.

The dataset contains **57** simulated primary-care style consultations (doctor ↔ patient). Each dialog is stored as an individual JSON file and includes a sequence of turns labelled by speaker.

---
## How to use (Automatically, using `Dialog.from_huggingface()`)

Simply use the [`Dialog.from_huggingface()`](https://sdialog.readthedocs.io/en/latest/api/sdialog.html#sdialog.Dialog.from_huggingface) as in the following example:

```python
from sdialog import Dialog

primock57_dialogs = Dialog.from_huggingface("sdialog/Primock-57")

print("Number of dialogs:", len(primock57_dialogs))
```

---
## How to use (Manually, using `Dialog.from_file()`)

Alternatively, if you want to do it manually, you have to:

1. First, download the dataset from the Hugging Face Hub to a local directory (e.g., `"Primock-57"`):

```python
from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="sdialog/Primock-57",
    repo_type="dataset",
    local_dir="Primock-57",
)
```

2. Then, load the dataset as `Dialog` objects:

```python
from sdialog import Dialog

primock57_dialogs = Dialog.from_file("Primock-57/")
print("Number of dialogs:", len(primock57_dialogs))

# Pretty-print the first dialog
primock57_dialogs[0].print()
```

You can also load an individual dialog by specifying its file path directly:

```python
from sdialog import Dialog

consultation01_dialog = Dialog.from_file("Primock-57/day1_consultation01_conversation.json")
consultation01_dialog.print()
```

## License

[Creative Commons Attribution 4.0 International (CC BY 4.0)](https://github.com/babylonhealth/primock57?tab=License-1-ov-file#readme)