ProsusAI / finBERT

Financial Sentiment Analysis with BERT
Apache License 2.0
1.45k stars 417 forks source link

Error in _read_tsv when trying to read in the data #48

Closed jfritsche1 closed 3 years ago

jfritsche1 commented 3 years ago

Hey there! I found that when trying to train the model there was an error, because the _read_tsv's call to open on line 63 in Utils.py didn't have the encoding specified.

To fix it I changed it from: def _read_tsv(cls, input_file): with open(input_file, "r") as f: To: def _read_tsv(cls, input_file): with open(input_file, "r",encoding='utf-8') as f: Now it works great! Thanks!

mahmuduzzaman commented 3 years ago

While using a model from path, it is asking for a config.json file. If i use the config file from this project i get the following error:

raise ValueError(

ValueError: Unrecognized model in ../models/en/. Should have a model_type key in its config.json, or contain one of the following strings in its name: speech_to_text, wav2vec2, m2m_100, convbert, led, blenderbot-small, retribert, ibert, mt5, t5, mobilebert, distilbert, albert, bert-generation, camembert, xlm-roberta, pegasus, marian, mbart, mpnet, bart, blenderbot, reformer, longformer, roberta, deberta-v2, deberta, flaubert, fsmt, squeezebert, bert, openai-gpt, gpt2, transfo-xl, xlnet, xlm-prophetnet, prophetnet, xlm, ctrl, electra, encoder-decoder, funnel, lxmert, dpr, layoutlm, rag, tapas Cuda is available: True Running train for en

doguaraci commented 3 years ago

@mahmuduzzaman which version of the transformers library do you have installed?

sathyarr commented 10 months ago

While using a model from path, it is asking for a config.json file. If i use the config file from this project i get the following error:

raise ValueError(

ValueError: Unrecognized model in ../models/en/. Should have a model_type key in its config.json, or contain one of the following strings in its name: speech_to_text, wav2vec2, m2m_100, convbert, led, blenderbot-small, retribert, ibert, mt5, t5, mobilebert, distilbert, albert, bert-generation, camembert, xlm-roberta, pegasus, marian, mbart, mpnet, bart, blenderbot, reformer, longformer, roberta, deberta-v2, deberta, flaubert, fsmt, squeezebert, bert, openai-gpt, gpt2, transfo-xl, xlnet, xlm-prophetnet, prophetnet, xlm, ctrl, electra, encoder-decoder, funnel, lxmert, dpr, layoutlm, rag, tapas Cuda is available: True Running train for en

what's the resolution for this?