emanuelaboros commited on
Commit
1815b86
1 Parent(s): b5c59a6

Initial commit including model and configuration

Browse files
Files changed (3) hide show
  1. label_map.json +1 -0
  2. models.py +0 -3
  3. push_to_hf.py +1 -1
label_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"NE-COARSE-LIT": {"B-org": 0, "I-loc": 1, "I-org": 2, "O": 3, "B-prod": 4, "B-time": 5, "I-time": 6, "B-pers": 7, "B-loc": 8, "I-pers": 9, "I-prod": 10}, "NE-COARSE-METO": {"B-org": 0, "O": 1, "I-org": 2, "B-loc": 3, "I-loc": 4, "B-time": 5}, "NE-FINE-LIT": {"B-pers.ind": 0, "I-org.ent": 1, "B-prod.doctr": 2, "B-org.adm": 3, "B-loc.unk": 4, "B-loc.add.phys": 5, "I-loc.add.phys": 6, "I-time.date.abs": 7, "I-loc.adm.town": 8, "B-pers.coll": 9, "B-prod.media": 10, "I-loc.adm.nat": 11, "B-loc.adm.sup": 12, "B-loc.phys.geo": 13, "I-org.ent.pressagency": 14, "I-loc.adm.sup": 15, "I-pers.ind": 16, "I-loc.phys.hydro": 17, "O": 18, "B-loc.oro": 19, "B-pers.ind.articleauthor": 20, "I-loc.oro": 21, "I-loc.add.elec": 22, "B-time.date.abs": 23, "B-org.ent": 24, "I-loc.phys.geo": 25, "I-pers.coll": 26, "I-loc.fac": 27, "B-loc.phys.hydro": 28, "I-org.adm": 29, "I-prod.doctr": 30, "I-pers.ind.articleauthor": 31, "B-loc.add.elec": 32, "B-loc.adm.town": 33, "B-loc.adm.nat": 34, "I-loc.adm.reg": 35, "B-loc.fac": 36, "B-org.ent.pressagency": 37, "I-prod.media": 38, "B-loc.adm.reg": 39, "I-loc.unk": 40}, "NE-FINE-METO": {"I-org.ent": 0, "B-org.adm": 1, "I-org.adm": 2, "B-loc.fac": 3, "O": 4, "B-loc.oro": 5, "B-loc.adm.town": 6, "B-org.ent": 7, "I-loc.fac": 8, "B-time.date.abs": 9}, "NE-FINE-COMP": {"I-comp.name": 0, "B-comp.name": 1, "B-comp.title": 2, "I-comp.function": 3, "I-comp.title": 4, "B-comp.function": 5, "O": 6, "I-comp.demonym": 7, "B-comp.demonym": 8, "B-comp.qualifier": 9, "I-comp.qualifier": 10}, "NE-NESTED": {"I-loc.fac": 0, "B-loc.phys.hydro": 1, "B-pers.ind": 2, "I-org.ent": 3, "B-org.adm": 4, "I-org.adm": 5, "I-loc.adm.town": 6, "B-pers.coll": 7, "I-loc.adm.nat": 8, "B-loc.adm.town": 9, "B-loc.adm.sup": 10, "B-loc.phys.geo": 11, "I-pers.ind": 12, "B-loc.adm.nat": 13, "I-loc.adm.reg": 14, "B-loc.adm.reg": 15, "O": 16, "B-loc.oro": 17, "B-loc.fac": 18, "I-loc.oro": 19, "B-org.ent": 20, "I-loc.phys.geo": 21, "I-loc.phys.hydro": 22, "B-prod.media": 23, "I-prod.media": 24}}
models.py CHANGED
@@ -33,9 +33,6 @@ class ExtendedMultitaskModelForTokenClassification(PreTrainedModel):
33
  self.num_token_labels_dict = get_info(label_map)
34
  self.config = config
35
 
36
- import pdb
37
-
38
- pdb.set_trace()
39
  self.bert = AutoModel.from_pretrained(
40
  config.pretrained_config["_name_or_path"], config=config.pretrained_config
41
  )
 
33
  self.num_token_labels_dict = get_info(label_map)
34
  self.config = config
35
 
 
 
 
36
  self.bert = AutoModel.from_pretrained(
37
  config.pretrained_config["_name_or_path"], config=config.pretrained_config
38
  )
push_to_hf.py CHANGED
@@ -60,7 +60,7 @@ def push_model_to_hub(checkpoint_dir, repo_name, script_path):
60
  # Copy all Python files to the local repository directory
61
  current_dir = os.path.dirname(os.path.abspath(__file__))
62
  for filename in os.listdir(current_dir):
63
- if filename.endswith(".py"):
64
  shutil.copy(
65
  os.path.join(current_dir, filename),
66
  os.path.join(local_repo_path, filename),
 
60
  # Copy all Python files to the local repository directory
61
  current_dir = os.path.dirname(os.path.abspath(__file__))
62
  for filename in os.listdir(current_dir):
63
+ if filename.endswith(".py") or filename.endswith(".json"):
64
  shutil.copy(
65
  os.path.join(current_dir, filename),
66
  os.path.join(local_repo_path, filename),