I can't create a custom chatbot system

Publié presque 3 ans il y a par  saidbicer

Publier un sujet
Non résolus
s
saidbicer

Hi,

I am an android developer. I'm developing apps for Pepper.

I need help with something on android side.

I'm developing a custom chatbot over the BaseChatbot class. 
But I never get the listened text. phrase.getText() in the replyTo function is always empty. I tried the language in English and Turkish, the result did not change.
The GreetingChatbot example on the following page is not working


1 Votes


13 Commentaires

Triés par
C

Clement Portales publiés presque 3 ans il y a Administrateur

Hello saidbicer, 


I can have a look into your issues. Can you indicate to me : 

- the Hardware and Software version of the Pepper you are using ? 

- do you have a nao-diagnosis available ? 

- do you have the logs of whenever the issue is happening ? 

- If possible, can you share your code so we can look into it ? 

0 Votes

s

saidbicer publiés presque 3 ans il y a

Hello, Thank you for your help.




Naoqi version : 2.9.5

Pepper 1.8a


 

public class GreetingChatbot extends BaseChatbot {

    private static final String TAG = "GreetingChatbot";

    static private List<String> greetings = Arrays.asList( "hello", "hi", "good morning", "good afternoon", "good evening" );

    public GreetingChatbot(QiContext context) {
        super(context);
    }

    @Override
    public StandardReplyReaction replyTo(@NonNull Phrase phrase, Locale locale) {
        
        Log.e("text", phrase.getText());
        
        if (greetings.contains(phrase.getText())) {
            return new StandardReplyReaction(
                    new MyChatbotReaction(getQiContext(), "Hello you"),
                    ReplyPriority.NORMAL);
        } else {
            return new StandardReplyReaction(
                    new MyChatbotReaction(getQiContext(), ""),
                    ReplyPriority.FALLBACK);
        }
    }

    @Override
    public void acknowledgeHeard(Phrase phrase, Locale locale) {
        Log.i(TAG, "Last phrase heard by the robot and whose chosen answer is not mine: " + phrase.getText());
    }

    @Override
    public void acknowledgeSaid(Phrase phrase, Locale locale) {
        Log.i(TAG, "Another chatbot answered: " + phrase.getText());
    }


    class MyChatbotReaction extends BaseChatbotReaction {

        private String answer;
        private Future<Void> fSay;

        MyChatbotReaction(final QiContext context, String answer) {
            super(context);
            this.answer = answer;
        }

        @Override
        public void runWith(SpeechEngine speechEngine) {

            Say say = SayBuilder.with(speechEngine)
                    .withText(answer)
                    .build();
            fSay = say.async().run();

            try {
                fSay.get(); // Do not leave the method before the actions are done
            } catch (ExecutionException e) {
                Log.e(TAG, "Error during Say", e);
            } catch (CancellationException e) {
                Log.i(TAG, "Interruption during Say");
            }
        }

        @Override
        public void stop() {
            if (fSay != null) {
                fSay.cancel(true);
            }
        }
    }
}

 



 

  Log.e("text", phrase.getText());

 This line never gets any text.



0 Votes

C

Clement Portales publiés presque 3 ans il y a Administrateur

Actually this  


Log.e("text", phrase.getText()); 


isn't in the example from  https://developer.softbankrobotics.com/pepper-qisdk/api/conversation/reference/basechatbot

What are you trying to achieve with this line ? 


0 Votes

s

saidbicer publiés presque 3 ans il y a

The code I sent is the same example as the one in the link you gave. Java version.


 

if (greetings.contains(phrase.getText()))



The incoming text in the expression is compared with the string. But the problem is that phrase.getText() always returns null.


I want to send the text that will come here to a web service and return a response via the smart assistant.


But I can't see the sentence heard by the robot as text.


The dialog created as a .top file is fine. I want to capture the dialogs that I did not write in the .top file on the code side.


0 Votes

C

Clement Portales publiés presque 3 ans il y a Administrateur

I believe you are trying it live on your Pepper. Can you describe or maybe take a picture of the blue speech bar when you are talking to pepper ? 

A custom chatbot requires an available remote speech recognition : if the speech bar always returns "?" or "<>", it might be that your remote speech recognition is not active, which you should request to Softbank. 


0 Votes

s

saidbicer publiés presque 3 ans il y a

Thank you for the answer.


Yes, I am working with a real robot.


I didn't know that an option called remote speech recognition needed to be enabled. This is definitely my problem.


I searched the internet for the phrase "remote speech recognition".


The problem here is the same as mine.


https://stackoverflow.com/questions/56972445/add-cloud-speech-recognition-to-pepper-qisdk


Those who contacted Softbank could not get any results.



Here are the marks I got in the blue area:

In wildcards = "<>"

In remote chatbot recognition = "?"



I hesitate to email Softbank. I have a new robot, I emailed it to be added to the command center. It's been a week and they still haven't responded.

1 Votes

C

Clement Portales publiés presque 3 ans il y a Administrateur

Yes I understand, Softbank has undergone a restructuration lately and their support has been overwhelmed since. 

If you have bought the robots from Softbank, they will be the only ones able to activate the remote speech recognition service for you. 

You can contact them through the ticket platform : https://account.aldebaran.com/support/


If you don't get an answer in the next days, I'll try to see what I can do to help you.

0 Votes

s

saidbicer publiés presque 3 ans il y a

Thank you for your answer. See you soon, bye

1 Votes

Abdelhadi. hireche

Abdelhadi. hireche publiés sur un an il y a

Hello @saidbicer ,

I'm facing the same problem, were you able to solve it after contacting the support, please give me any kind of assistance, I been rolling out with problem for days now, how can I add google speech to api or any other remote speech module.

1 Votes

Z

Zhoumintong publiés 6 mois il y a

Dear @saidbicer,


 I meet the same problem, and  guess it's caused by  the remote speech recognition service which is not  activated. Did you finally solve the problem ? Could you please share the way to solve this problem.



0 Votes

S

Soztag-lab publiés 6 mois il y a

 Hey wanted to ask around about your idea, have some idea for local gpt maybe in the future, if the bosses allow that xD. Kind regards and at Service, T.B

0 Votes

S

Soztag-lab publiés 6 mois il y a

Hey wanted to ask again. Kind regards and at Service, T.B from NCT

0 Votes

Z

Zhoumintong publiés 6 mois il y a

Thanks for update. Hope we can have positive feedback before long . 

1 Votes

Connexion ou S'inscrire pour poster un commentaire