Commit 34bc457f authored by Fabian Ziegner's avatar Fabian Ziegner
Browse files

Added config

parent 991bea2c
name:
user:
host:
port: 27017
database:
auth:
pw:
......
......@@ -2,5 +2,8 @@ mdbh~=0.4
flair~=0.8.0.post1
torch~=1.7.1
sacred~=0.8.1
tqdm~=4.46.0
tqdm~=4.47.0
transformers~=4.0.0
yaml~=0.2.5
pyyaml~=5.3.1
pandas~=1.0.5
\ No newline at end of file
......@@ -9,17 +9,22 @@ from sacred.utils import apply_backspaces_and_linefeeds
from torch.utils.data import DataLoader
from tqdm import tqdm
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
import yaml
name = ""
user = ""
host = ""
database = ""
auth = ""
pw = ""
with open("config.yaml", "r") as f:
config = yaml.load(f, Loader=yaml.SafeLoader)
name = config["name"]
user = config["user"]
host = config["host"]
port = config["port"]
database = config["database"]
auth = config["auth"]
pw = config["pw"]
SETTINGS.CAPTURE_MODE = "sys"
ex = Experiment(name)
ex.observers.append(MongoObserver(url="localhost:27017", db_name=database))
ex.observers.append(MongoObserver(url=f"{host}:{port}", db_name=database))
ex.captured_out_filter = apply_backspaces_and_linefeeds
......
from zeroshot import ex
import yaml
device = "0"
with open("config.yaml", "r") as f:
config = yaml.load(f, Loader=yaml.SafeLoader)
representation = "tars-base"
method = "flair"
datasets = config["datasets"]
target = "single"
threshold = "max"
datasets = ["agnews", "dbpedia", "trec6", "trec50", "yahoo_answers", "amazonfull", "yelpfull"]
single = ["wiki30k", "20newsgroup", "agnews", "dbpedia", "yahoo_answers", "movie_reviews", "trec6", "trec50", "yelpfull", "amazonfull"]
multi = ["rcv1", "blurbgenrecollection", "blurbgenrecollection_de", "ohsumed",]
for dataset in datasets:
experiment = ex.run(options={'--name': f'{dataset}-TARS_base'},
config_updates={'representation': representation, 'target': target, 'dataset': dataset,
'threshold': threshold, 'device': device, 'method': method})
if dataset in single:
target = "single"
threshold = "max"
elif dataset in multi:
target = "multi"
threshold = config["multi_threshold"]
target = "multi"
threshold = "mcut"
datasets = ["blurbgenrecollection", "rcv1"]
for dataset in datasets:
experiment = ex.run(options={'--name': f'{dataset}-TARS_base'},
config_updates={'representation': representation, 'target': target, 'dataset': dataset,
'threshold': threshold, 'device': device, 'method': method})
experiment = ex.run(options={'--name': f'{dataset}-{config["representation"]}'},
config_updates={'device': config["device"],
"batch_size": config["batch_size"],
'representation': config["representation"],
"target": target,
'threshold': threshold,
"formatted": config["formatted"],
"cut_sample": config["cut_sample"],
'method': config["method"],
"whole_dataset": config["whole_dataset"],
'dataset': dataset})
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment