Update collaboration.py
Browse files- collaboration.py +7 -7
collaboration.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
from datasets import Dataset
|
| 2 |
from typing import Dict, List
|
| 3 |
|
| 4 |
-
|
| 5 |
|
| 6 |
-
def add_collaboration_note(
|
| 7 |
record = {
|
| 8 |
-
"document":
|
| 9 |
"note": note
|
| 10 |
}
|
| 11 |
-
|
| 12 |
return record
|
| 13 |
|
| 14 |
-
def get_collaboration_dataset():
|
| 15 |
-
if not
|
| 16 |
return Dataset.from_dict({"document": [], "note": []})
|
| 17 |
-
return Dataset.from_list(
|
|
|
|
| 1 |
from datasets import Dataset
|
| 2 |
from typing import Dict, List
|
| 3 |
|
| 4 |
+
_COLLAB: List[Dict] = []
|
| 5 |
|
| 6 |
+
def add_collaboration_note(document: str, note: str) -> Dict:
|
| 7 |
record = {
|
| 8 |
+
"document": document,
|
| 9 |
"note": note
|
| 10 |
}
|
| 11 |
+
_COLLAB.append(record)
|
| 12 |
return record
|
| 13 |
|
| 14 |
+
def get_collaboration_dataset() -> Dataset:
|
| 15 |
+
if not _COLLAB:
|
| 16 |
return Dataset.from_dict({"document": [], "note": []})
|
| 17 |
+
return Dataset.from_list(_COLLAB)
|