Comments (11)
ah hm i notice this from time to time: I remember this issue existing already but perhaps we thought it went away. I think maybe first noticed this a few weeks ago?
from bot_or_not.
ahh this is very elusive - it only seems to happen when the bot double-texts (never when it's the first response to a user message). When did you add that functionality?
from bot_or_not.
it's been there for a couple of months, but we're using it more now -- when there's punctuation in a bot's response, it splits the message in two and adds it to bot queue. It doesn't use anything special though: everything just goes through the bot queue.
recently I added in a 'line break' character that allows the bot to text over multiple lines without having punctuation to split them, which is probably why we're seeing this more.
from bot_or_not.
ohhh ok great thats helpful - yes the \n can totally be the culprit here
from bot_or_not.
ahhh it's not a \n though -- it's just appending 2 messages to the queue separately
from bot_or_not.
hmmmmmmm.... what it does is splits the sentence into an array, and concatenates that to the bot queue... which is maybe not quite the same
processResponse = (text) => {
//check if message pure punctuation, let it pass if so
if (text.match(/[a-zA-Z]/g)){
//breaks sentences into different messages
text = text
.match(/[^.!?%]+[.!?]*/g)
.map(str => str.trim());
}
else if (!text) {
text = handleError();
}
this.botQueue = this.botQueue.concat(text);
// random pause before the bot starts typing, as if thinking
setTimeout(() => this.setState({isBotTyping: true}, () =>
this.processBotQueue()), this.getRandomInt(1100, 3500));
}
from bot_or_not.
so the regex is looking for punctuation, or the 'newline' character %
: if there's punctuation it splits and keeps the punctuation, if there's a %
it splits and gets rid of the %
.
from bot_or_not.
ok I will play a bit with that and report back
from bot_or_not.
yeah. there's also one tiny hack that I did to make the bot dots appear at the start of rounds (they only get appended once there are messages on the screen) that just appends a blank message, before the bot starts typing. but the dots aren't distorted underneath that I don't think (+ I feel like we'd already seen the dots getting displaced before that...)
that's done here:
if(this.state.messages.length === 0) {
//if start of interaction, adds a blank
//message to kickstart the 'bot dots'
this.appendMessage('');
this.processResponse(response);
}
from bot_or_not.
^ very likely this is the reason, but I'm also investigating whether the trim()
function you are using has the results we want (whether it creates a new variable or operates on the existing one)
from bot_or_not.
from bot_or_not.
Related Issues (20)
- since there is an opponent name, make the bot use that if asked "what is your name" ? HOT 5
- last screen - the header shouldn't have a countdown HOT 1
- advance the dialogue format from single<-->single text to multiple <--> single or multiple <---> multiple HOT 3
- message queue not being cleared properly HOT 3
- No 'wait' screen before final truth round HOT 5
- player name gets set to whatever the last message they sent was
- hook Intro bot into Free Chat component HOT 1
- breakdown Intro flow into more screens HOT 1
- little pauses before bot reveal, and before player is matched
- (potential) ability to make rounds longer than 1min
- better 'filler' words
- better context buffer
- timer not clearing properly before start of next round HOT 1
- ...some screens get skipped mysteriously HOT 2
- move nlp to it's own file
- add 'data disclosure' screen at the start HOT 2
- add link to 'about' at the end of the interaction
- remove "first up: Truth" screen? HOT 3
- Add blacklisted words
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bot_or_not.