Datasets:

Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Libraries:
Datasets
Dask
License:
sergioburdisso commited on
Commit
d4fa151
·
verified ·
1 Parent(s): cccfa19

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -9
README.md CHANGED
@@ -2,23 +2,46 @@
2
  license: cc-by-4.0
3
  ---
4
 
5
- A version of the [Primock-57](https://github.com/babylonhealth/primock57) dataset converted to [sdialog](https://github.com/idiap/sdialog) `Dialog` json format, so they can be loaded as dialog objects with `Dialog.from_file(path/to/dialog.json)`.
 
 
 
 
 
 
 
6
 
7
- Example usage:
8
  ```python
9
- from sdialog import Dialog
10
  from huggingface_hub import snapshot_download
11
 
12
- # Download the Primock-57 dataset from Hugging Face Hub to a local "datasets" directory
13
- snapshot_download(repo_id="sdialog/Primock-57", repo_type="dataset",
14
- local_dir="datasets")
 
 
 
 
 
 
 
 
15
 
16
- # Load the Primock-57 dataset as Dialog object
17
  primock57_dialogs = Dialog.from_file("datasets/Primock-57/")
18
  print("Number of dialogs:", len(primock57_dialogs))
19
 
20
- # Let's pretty-print the first dialog
21
  primock57_dialogs[0].print()
22
  ```
23
 
24
- **License:** [Creative Commons Attribution 4.0 International](https://github.com/babylonhealth/primock57?tab=License-1-ov-file#readme)
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: cc-by-4.0
3
  ---
4
 
5
+ # Primock-57
6
+
7
+ 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.
8
+ It allows easy loading as dialog objects via `Dialog.from_file()`.
9
+
10
+ ## How to use
11
+
12
+ First, download the dataset from the Hugging Face Hub to a local directory (e.g., `"datasets"`):
13
 
 
14
  ```python
 
15
  from huggingface_hub import snapshot_download
16
 
17
+ snapshot_download(
18
+ repo_id="sdialog/Primock-57",
19
+ repo_type="dataset",
20
+ local_dir="datasets",
21
+ )
22
+ ```
23
+
24
+ Then, load the dataset as `Dialog` objects:
25
+
26
+ ```python
27
+ from sdialog import Dialog
28
 
 
29
  primock57_dialogs = Dialog.from_file("datasets/Primock-57/")
30
  print("Number of dialogs:", len(primock57_dialogs))
31
 
32
+ # Pretty-print the first dialog
33
  primock57_dialogs[0].print()
34
  ```
35
 
36
+ You can also load an individual dialog by specifying its file path directly:
37
+
38
+ ```python
39
+ from sdialog import Dialog
40
+
41
+ consultation01_dialog = Dialog.from_file("datasets/Primock-57/day1_consultation01_conversation.json")
42
+ consultation01_dialog.print()
43
+ ```
44
+
45
+ ## License
46
+
47
+ [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://github.com/babylonhealth/primock57?tab=License-1-ov-file#readme)