Coder Social home page Coder Social logo

vidhi1290 / multi-class-text-classification-using-bert-model Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 27 KB

Predict consumer financial product categories using BERT, based on over two million customer complaints. This project involves data processing, model building with pre-trained BERT, and making predictions on new text data.

Jupyter Notebook 90.18% Python 9.82%
bert bert-fine-tuning bert-model multiclass-classification nlp pandas python sklearn text-classificaiton-with-bert text-classification torch tqdm transformers

multi-class-text-classification-using-bert-model's People

Contributors

vidhi1290 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

multi-class-text-classification-using-bert-model's Issues

"Encounter of RuntimeError at the Second Epoch in BERT Multiclass Text Classification"

@Vidhi1290 I just want to thank you for sharing your work with us. while training the model i encountered following error.
/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction, label_smoothing)
3057 if size_average is not None or reduce is not None:
3058 reduction = _Reduction.legacy_get_string(size_average, reduce)
-> 3059 return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

RuntimeError: size mismatch (got input: [6], target: [1])
This error occurred during the second epoch, at approximately 96% completion. It's worth noting that initially, the model was successfully trained for 1 epoch on the CPU without any issues.

Changes Made Before Using the Model
Before training the model, I made changes to some variables at the top of the notebook according to my requirements. These changes included adjusting variables such as label_col, tokens_path, and labels_path. No other modifications were made to the code or the model architecture.

Data Information
My data is structured in a CSV file with two columns: one for the text of the questions and another for the associated labels (levels 1-6). There are a total of 6 classes in the classification, with each text question associated with a specific level in the next column.

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.