Quantcast
Viewing all articles
Browse latest Browse all 9

AttributeError: ‘str’ object has no attribute ‘confidence’

Estou desenvolvendo um chatbot e gostaria que ele só respondesse se tivesse determinado nível de confiança na resposta.

#Recebe qualquer outra mensagem @bot.message_handler(func=lambda message:True) def mensagem(message):     bot_convencional(message.text)     resposta = open("arquivos/teste", "r")     resposta = resposta.read()     if float(resposta.confidence) > 0.5:         bot.reply_to(message, resposta)     else:         bot.reply_to(message, "Como você está se sentindo?") bot.polling() 

O problema é que quando eu tento usar o confidence dá o erro

if float(resposta.confidence) > 0.5: AttributeError: ‘str’ object has no attribute ‘confidence’

Já usei confidence em outro chatbot e não entendo porque está dando esse problema dessa vez. Alguém pode me ajudar?

The post AttributeError: ‘str’ object has no attribute ‘confidence’ appeared first on 100% Private Proxies - Fast, Anonymous, Quality, Unlimited USA Private Proxy!.


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>