KoichiYasuoka commited on
Commit
44b79a8
1 Parent(s): 2476cda

model improved

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. maker.py +3 -3
  3. pytorch_model.bin +1 -1
README.md CHANGED
@@ -18,7 +18,7 @@ widget:
18
 
19
  ## Model Description
20
 
21
- This is a DeBERTa(V2) model pretrained on Japanese Wikipedia and 青空文庫 texts for POS-tagging and dependency-parsing (using `goeswith` for subwords), derived from [deberta-base-japanese-wikipedia](https://huggingface.co/KoichiYasuoka/deberta-base-japanese-wikipedia) and [UD_Japanese-GSDLUW](https://github.com/UniversalDependencies/UD_Japanese-GSDLUW).
22
 
23
  ## How to Use
24
 
 
18
 
19
  ## Model Description
20
 
21
+ This is a DeBERTa(V2) model pretrained on Japanese Wikipedia and 青空文庫 texts for POS-tagging and dependency-parsing (using `goeswith` for subwords), derived from [deberta-base-japanese-wikipedia-luw-upos](https://huggingface.co/KoichiYasuoka/deberta-base-japanese-wikipedia-luw-upos) and [UD_Japanese-GSDLUW](https://github.com/UniversalDependencies/UD_Japanese-GSDLUW).
22
 
23
  ## How to Use
24
 
maker.py CHANGED
@@ -1,5 +1,5 @@
1
  #! /usr/bin/python3
2
- src="KoichiYasuoka/deberta-base-japanese-wikipedia"
3
  tgt="KoichiYasuoka/deberta-base-japanese-wikipedia-ud-goeswith"
4
  url="https://github.com/UniversalDependencies/UD_Japanese-GSDLUW"
5
  import os
@@ -46,9 +46,9 @@ trainDS=UDgoeswithDataset("train.conllu",tkz)
46
  devDS=UDgoeswithDataset("dev.conllu",tkz)
47
  testDS=UDgoeswithDataset("test.conllu",tkz)
48
  lid=trainDS(devDS,testDS)
49
- cfg=AutoConfig.from_pretrained(src,num_labels=len(lid),label2id=lid,id2label={i:l for l,i in lid.items()})
50
  arg=TrainingArguments(num_train_epochs=3,per_device_train_batch_size=32,output_dir="/tmp",overwrite_output_dir=True,save_total_limit=2,evaluation_strategy="epoch",learning_rate=5e-05,warmup_ratio=0.1)
51
- trn=Trainer(args=arg,data_collator=DataCollatorForTokenClassification(tkz),model=AutoModelForTokenClassification.from_pretrained(src,config=cfg),train_dataset=trainDS,eval_dataset=devDS)
52
  trn.train()
53
  trn.save_model(tgt)
54
  tkz.save_pretrained(tgt)
 
1
  #! /usr/bin/python3
2
+ src="KoichiYasuoka/deberta-base-japanese-wikipedia-luw-upos"
3
  tgt="KoichiYasuoka/deberta-base-japanese-wikipedia-ud-goeswith"
4
  url="https://github.com/UniversalDependencies/UD_Japanese-GSDLUW"
5
  import os
 
46
  devDS=UDgoeswithDataset("dev.conllu",tkz)
47
  testDS=UDgoeswithDataset("test.conllu",tkz)
48
  lid=trainDS(devDS,testDS)
49
+ cfg=AutoConfig.from_pretrained(src,num_labels=len(lid),label2id=lid,id2label={i:l for l,i in lid.items()},ignore_mismatched_sizes=True,task_specific_params=None)
50
  arg=TrainingArguments(num_train_epochs=3,per_device_train_batch_size=32,output_dir="/tmp",overwrite_output_dir=True,save_total_limit=2,evaluation_strategy="epoch",learning_rate=5e-05,warmup_ratio=0.1)
51
+ trn=Trainer(args=arg,data_collator=DataCollatorForTokenClassification(tkz),model=AutoModelForTokenClassification.from_pretrained(src,config=cfg,ignore_mismatched_sizes=True),train_dataset=trainDS,eval_dataset=devDS)
52
  trn.train()
53
  trn.save_model(tgt)
54
  tkz.save_pretrained(tgt)
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ec89b5bb67220bfb1cc206157a63327c0e7533501a7fb9e2fa7132a5dc7ef88e
3
  size 498741331
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38da14abca09c2361a28518d060c6438e5bf3c3c99da1cf6584a69484d85b917
3
  size 498741331