#624 · Primary category: Education & Research

BertWithPretrained

bert deep-learning nlp pretrained-models pytorch question-answering squad swag text-classification

An implementation of the BERT model and its related downstream tasks based on the PyTorch framework. @跟我学机器学习

Project last updated:07/25/25

GitHub Stars

604

Forks

108

Contributors

1

License

Other

Why we included this project

BertWithPretrained builds BERT from scratch in PyTorch, walking through the model layer by layer from self-attention and input embeddings to the full encoder stack. The repo pairs that architecture with seven working downstream tasks, including Chinese text classification, MNLI-style pair classification, SWAG multiple choice, SQuAD question answering, NSP/MLM pretraining, and Chinese named entity recognition, each with its own dataset and runnable training script. For developers who want to see how a pretrained transformer connects to different task heads instead of treating Hugging Face as a black box, the modular code and per-task explanations make a solid study path. It works best as a teaching resource and reference for understanding BERT internals and fine-tuning patterns, not as a production deployment library.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category