Upload database.py
Browse files- database.py +3 -2
database.py
CHANGED
|
@@ -5,13 +5,14 @@ from fuzzywuzzy import fuzz
|
|
| 5 |
from itertools import chain
|
| 6 |
from zipfile import ZipFile
|
| 7 |
from copy import deepcopy
|
| 8 |
-
from convlab.util.unified_datasets_util import BaseDatabase
|
| 9 |
|
| 10 |
|
| 11 |
class Database(BaseDatabase):
|
| 12 |
def __init__(self):
|
| 13 |
"""extract data.zip and load the database."""
|
| 14 |
-
|
|
|
|
| 15 |
self.domains = ['restaurant', 'hotel', 'attraction', 'train', 'hospital', 'police']
|
| 16 |
self.dbs = {}
|
| 17 |
for domain in self.domains:
|
|
|
|
| 5 |
from itertools import chain
|
| 6 |
from zipfile import ZipFile
|
| 7 |
from copy import deepcopy
|
| 8 |
+
from convlab.util.unified_datasets_util import BaseDatabase, download_unified_datasets
|
| 9 |
|
| 10 |
|
| 11 |
class Database(BaseDatabase):
|
| 12 |
def __init__(self):
|
| 13 |
"""extract data.zip and load the database."""
|
| 14 |
+
data_path = download_unified_datasets('multiwoz21', 'data.zip', os.path.dirname(os.path.abspath(__file__)))
|
| 15 |
+
archive = ZipFile(data_path)
|
| 16 |
self.domains = ['restaurant', 'hotel', 'attraction', 'train', 'hospital', 'police']
|
| 17 |
self.dbs = {}
|
| 18 |
for domain in self.domains:
|