ee0d111d02961a89679e9128b46b40c1df98efb6,parlai/scripts/detect_offensive_language.py,,detect,#Any#Any#Any#,31
Before Change
if log_every_n_secs <= 0:
log_every_n_secs = float("inf")
log_time = Timer()
tot_time = 0
// Show some example dialogs:
cnt = 0
while not world.epoch_done():
world.parley()
offensive = False
for a in world.acts:
if bad.contains_offensive_language(a.get("text", "")):
offensive = True
labels = a.get("labels", a.get("eval_labels", ""))
for l in labels:
if bad.contains_offensive_language(l):
offensive= True
if offensive:
if opt["display_examples"]:
print(world.display() + "\n~~")
cnt += 1
if log_time.time() > log_every_n_secs:
tot_time += log_time.time()
report = world.report()
log = {"total": report["total"]}
log["done"] = report["total"] / world.num_examples()
if log["done"] > 0:
log["eta"] = int(tot_time / log["done"] - tot_time)
z = "%.2f" % ( 100*log["done"])
log["done"] = str(z) + "%"
log["offenses"] = cnt
print(str(int(tot_time)) + "s elapsed: " + str(log))
log_time.reset()
if world.epoch_done():
print("EPOCH DONE")
After Change
if log_time.time() > log_every_n_secs:
report = world.report()
log = { "offenses": cnt }
text, log = log_time.log(report["total"], world.num_examples(), log)
print(text)
if world.epoch_done():
print("EPOCH DONE")
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 7
Instances
Project Name: facebookresearch/ParlAI
Commit Name: ee0d111d02961a89679e9128b46b40c1df98efb6
Time: 2018-06-14
Author: jaseweston@gmail.com
File Name: parlai/scripts/detect_offensive_language.py
Class Name:
Method Name: detect
Project Name: pymc-devs/pymc3
Commit Name: fd76e96ce1a9718be1ae141c5f3cabddf48ca85f
Time: 2020-09-27
Author: dominik.otto@izi.fraunhofer.de
File Name: pymc3/distributions/transforms.py
Class Name: StickBreaking
Method Name: forward
Project Name: facebookresearch/ParlAI
Commit Name: ee0d111d02961a89679e9128b46b40c1df98efb6
Time: 2018-06-14
Author: jaseweston@gmail.com
File Name: parlai/scripts/eval_model.py
Class Name:
Method Name: eval_model
Project Name: pymc-devs/pymc3
Commit Name: fd76e96ce1a9718be1ae141c5f3cabddf48ca85f
Time: 2020-09-27
Author: dominik.otto@izi.fraunhofer.de
File Name: pymc3/distributions/transforms.py
Class Name: StickBreaking
Method Name: forward_val