Giter Site home page Giter Site logo

jiahaozhenbang / scope Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 4.0 293 KB

Source code for the paper "Improving Chinese Spelling Check by Character Pronunciation Prediction: The Effects of Adaptivity and Granularity" in EMNLP 2022

Python 98.83% Shell 1.17%

scope's People

Contributors

jiahaozhenbang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

scope's Issues

About pretraining data

Thanks for your great work!
Could you please provide the parallel csc data which generate by using confusion set and wiki2019zh ? ❤

AttributeError: Can't pickle local object 'get_linear_schedule_with_warmup.<locals>.lr_lambda'

The following error occurred when I used 2 GeForce RTX 3090 with 24G memory on the server. Please kindly answer it.
Traceback (most recent call last):
File "/root/autodl-tmp/SCOPE/finetune/train.py", line 433, in
main()
File "/root/autodl-tmp/SCOPE/finetune/train.py", line 426, in main
trainer.fit(model)
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 735, in fit
self._call_and_handle_interrupt(
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 682, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 770, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1193, in _run
self._dispatch()
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1272, in _dispatch
self.training_type_plugin.start_training(self)
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/ddp_spawn.py", line 173, in start_training
self.spawn(self.new_process, trainer, self.mp_queue, return_result=False)
File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/ddp_spawn.py", line 201, in spawn
mp.spawn(self._wrapped_function, args=(function, args, kwargs, return_queue), nprocs=self.num_processes)
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 239, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
process.start()
File "/root/miniconda3/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/root/miniconda3/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/root/miniconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/root/miniconda3/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/root/miniconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/root/miniconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'get_linear_schedule_with_warmup..lr_lambda'

On training with 2 gpu

Hello, excuse me, I want to know how you use two cpus for training, I wonder if it is convenient for you to tell me, looking forward to your reply! Thanks!

Can't reproduce the results.

I try to reproduce the result in the paper. I completely follow the environment in the README.md file.

I have run 30 epochs by 'train.sh' script, and the final checkpoints are the following:

epoch=23-df=79.3537-cf=78.0969.ckpt 
epoch=25-df=80.1070-cf=78.1445.ckpt 
epoch=26-df=80.1810-cf=78.5520.ckpt 
epoch=28-df=80.1802-cf=78.7387.ckpt  
epoch=29-df=80.2158-cf=78.5971.ckpt

I used the final checkpoint to evaluate the model by sighan 2015 and I got the results is following:

# without CIC
'sent-detect-acc': 85.36363636363636, 'sent-detect-p': 78.10858143607706, 'sent-detect-r': 82.43992606284658, 'sent-detect-f1': 80.21582733812951, 'sent-correct-acc': 84.54545454545455, 'sent-correct-p': 76.5323992994746, 'sent-correct-r': 80.77634011090574, 'sent-correct-f1': 78.59712230215827, 'char-detect-f1': 86.45614035087719, 'char-correct-f1': 91.12964366944655

# with CIC
{'sent-detect-acc': 86.27272727272727, 'sent-detect-p': 79.75133214920072, 'sent-detect-r': 82.99445471349352, 'sent-detect-f1': 81.34057971014492, 'sent-correct-acc': 85.45454545454545, 'sent-correct-p': 78.15275310834814, 'sent-correct-r': 81.33086876155268, 'sent-correct-f1': 79.71014492753623, 'char-detect-f1': 87.1578947368421, 'char-correct-f1': 91.38972809667673}

The sentence-level correction results of the without CIC is the same as the Ablation Study. But the other results are totally different compared to the results in the paper.

I want to know what I did wrong and how to get the results in the paper. Looking forward to your reply.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.