Giter VIP home page Giter VIP logo

Comments (4)

doguaraci avatar doguaraci commented on July 16, 2024

Hi, the problem is with model_path. The model path should not be the .bin file but the folder that includes the .bin and config files.

from finbert.

m1996 avatar m1996 commented on July 16, 2024

thanks for your response
I made a folder named "model" which has pytorch_model.bin and config.json.
then I tried:
!python predict.py --text_path="./test.txt" --output_dir="./output/" --model_path="./model"
but still getting:

usage: predict.py [-h] [--data_path DATA_PATH]
predict.py: error: unrecognized arguments: --text_path=./test.txt --output_dir=./output/ --model_path=./model

when I try !python predict.py -h, I get:

usage: predict.py [-h] [--data_path DATA_PATH]

Sentiment analyzer

optional arguments:
  -h, --help            show this help message and exit
  --data_path DATA_PATH
                        Path to the text file.

looks like only wants one input but when I try with 1 input I get another error...
what am I doing wrong?

from finbert.

m1996 avatar m1996 commented on July 16, 2024

by the way, I move out predict.py and dataset.py from scripts folder to the main one.
And I am using colab so I did not make environment and simply !pip install all the dependencies:

!pip install jupyter==1.0.0
!pip install pandas==0.23.4
!pip install python==3.7.3
!pip install numpy==1.16.3
!pip install nltk
!pip install tqdm
!pip install ipykernel==5.1.3
!pip install transformers==4.1.1
!pip install joblib==0.13.2
!pip install scikit-learn==0.21.2
!pip install spacy==2.1.4
!pip install torch==1.1.0
!pip install textblob

is problem with these?

from finbert.

m1996 avatar m1996 commented on July 16, 2024

Hi, I've found the problem. I did as you said AND moved datasets.py to scripts folder and kept predict.py in the main folder.
then it run:))) but I got another error which fixed by

import nltk
nltk.download('punkt')

thank you so much. I will close the issue.

from finbert.

Related Issues (20)

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.