Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About loading models in pos_tagging.py #6

Open
tomohirok27 opened this issue Oct 28, 2021 · 1 comment
Open

About loading models in pos_tagging.py #6

tomohirok27 opened this issue Oct 28, 2021 · 1 comment

Comments

@tomohirok27
Copy link

tomohirok27 commented Oct 28, 2021

I have a question about the implementation of Part-of-Speech tagging.
The following command will tag the POS.

python3 pos_tagging.py --do_train --do_tagging train --gpus 0 1 --dataset_folder wikibio

--do_train will load the pre-trained model bert-base-uncased, perform fine tuning, and save the model in ./pos/trained.
But why does --do_tagging load --model_name_or_path bert-base-uncased in def run_script instead of loading the stored model in ./pos/trained ?

cmd = " ".join([
        f'CUDA_VISIBLE_DEVICES={gpus}',
        'python run_ner.py',
        f'--data_dir {pos_folder}/',
        '--model_type bert',
        f'--labels {os.path.join(pos_folder, "labels.txt")}',
        '--model_name_or_path bert-base-uncased',
        f'--output_dir {os.path.join(pos_folder, "trained")}',
        f'--max_seq_length {max_seq_length}',
        '--do_predict',
        '--per_gpu_eval_batch_size 64'
    ])
@zhangzhang827
Copy link

I have a question about the implementation of Part-of-Speech tagging. The following command will tag the POS.

python3 pos_tagging.py --do_train --do_tagging train --gpus 0 1 --dataset_folder wikibio

--do_train will load the pre-trained model bert-base-uncased, perform fine tuning, and save the model in ./pos/trained. But why does --do_tagging load --model_name_or_path bert-base-uncased in def run_script instead of loading the stored model in ./pos/trained ?

cmd = " ".join([
        f'CUDA_VISIBLE_DEVICES={gpus}',
        'python run_ner.py',
        f'--data_dir {pos_folder}/',
        '--model_type bert',
        f'--labels {os.path.join(pos_folder, "labels.txt")}',
        '--model_name_or_path bert-base-uncased',
        f'--output_dir {os.path.join(pos_folder, "trained")}',
        f'--max_seq_length {max_seq_length}',
        '--do_predict',
        '--per_gpu_eval_batch_size 64'
    ])

这个代码我也遇到了一些问题,请问您现在跑通了嘛?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants