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

Using the output variable (output_ts) of the data #25

Open
ghost opened this issue Jan 12, 2021 · 5 comments
Open

Using the output variable (output_ts) of the data #25

ghost opened this issue Jan 12, 2021 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 12, 2021

Hi,

I want to use the output variable which stores the aspect, sentiment pairs of the input sentence. I think it is the output_ts variable in work.py

I actually want to use it in a different .py file so I import the work.py like a module and I try to use output_ts there. The error I encounter is that work.py doesn't have an attribute named "output_ts". So I tried to return output_ts after the predict function inside work.py but that also didn't work. Is there a way to solve this issue?

@lixin4ever
Copy link
Owner

Hi,

I am very busy recently. Maybe we can discuss your issues after Feb 2.

@ghost
Copy link
Author

ghost commented Feb 1, 2021

Hello,

yes sure I will be waiting!

@lixin4ever
Copy link
Owner

Hi,

I want to use the output variable which stores the aspect, sentiment pairs of the input sentence. I think it is the output_ts variable in work.py

I actually want to use it in a different .py file so I import the work.py like a module and I try to use output_ts there. The error I encounter is that work.py doesn't have an attribute named "output_ts". So I tried to return output_ts after the predict function inside work.py but that also didn't work. Is there a way to solve this issue?

Work.py does NOT have an attribute called output_ts. You should set output_ts as (additional) return value of the predict function and then import the predict function (in another.py) from work.py. Every time you need to obtain the output_ts, just call the predict function in another.py.

This issue is more like a python issue, for the problems not related to our model, please google first and try to solve them by YOURSELF.

@ghost
Copy link
Author

ghost commented Feb 8, 2021

what should I put for args model tokenizer while calling predict in another.py?

@lixin4ever
Copy link
Owner

Basically, you need to write several lines of code to load the fine-tuned model and the tokenizer from the specified paths.

Just follow the procedure of the function main() in work.py.

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

1 participant