text2text icon indicating copy to clipboard operation
text2text copied to clipboard

qg not working

Open andre-macdonald opened this issue 4 years ago • 8 comments

Hi, I last used T2T 5 May 2021, today I want to produce more work and it wasn't working. I then downloaded the latest but it too isn't working . Please help. Thanks in advance for quick and positive response

andre-macdonald avatar May 26 '21 18:05 andre-macdonald

Take a look at the latest documentation in the README to update your code. If you still prefer the old API you can install previous versions according to the date you prefer.

artitw avatar May 26 '21 22:05 artitw

hi please help with the error I get, refer image. thanks in advance. T2T ERROR

andre-macdonald avatar May 27 '21 13:05 andre-macdonald

Looks like you are using the old API. Below are two options. I would recommend option 2 if possible.

  1. Install older version, e.g. pip install text2text==0.1.0 and keep your code as is. OR
  2. Use new API, e.g. pip install -U text2text and follow the code below.
from text2text import Handler
Handler([
            bio_str,
            bio_str,
            bio_str,
            bio_str,
            bio_str,
            "I will go to school today to take my math exam.",
            "I will go to school today to take my math exam.",
            "Tomorrow is my cousin's birthday. He will turn 24 years old.",
            notre_dame_str,
            bacteria_str,
            bacteria_str,
            bacteria_str,
            "I will go to school today to take my math exam. [SEP] school",
            "I will go to school today to take my math exam. [SEP] exam",
            "I will go to school today to take my math exam. [SEP] math",
          ], src_lang='en').question()

artitw avatar May 28 '21 14:05 artitw

T2T REC API N_WORK What am I doing wrong?

andre-macdonald avatar May 29 '21 18:05 andre-macdonald

Looks like a previous cell assigning the value for the variable bio_str has not been executed. Try running that, or just replace that line with your own text.

artitw avatar May 29 '21 18:05 artitw

Could you pleas provide an example screen shot of what you mean. I don't know how to code I'm learning as go. Thanks again

andre-macdonald avatar May 29 '21 20:05 andre-macdonald

No worries. Copy and paste the example below and adapt it to your needs. Let us know if it works, or if you get another error.

from text2text import Handler
Handler([
            "I will go to school today to take my math exam.",
            "I will go to school today to take my math exam.",
            "Tomorrow is my cousin's birthday. He will turn 24 years old.",
          ], src_lang='en').question()

artitw avatar May 29 '21 21:05 artitw

Working, Thank you so much! You're the best!

andre-macdonald avatar May 30 '21 05:05 andre-macdonald