Placeholder Image

字幕表 動画を再生する

  • what's going on?

  • Everybody and welcome to in R and D style video.

  • I don't normally do videos like this because it's basically either impossible are very difficult to structure things in such a way that people can follow along.

  • But in these times, I think people are pretty starved for content.

  • So I thought, you know, I could do a video on at least some of the stuff that I do that you guys really never see.

  • So Project, like what I've been working on here with this chap, is kind of so big and so just complex that probably there will never be a serious from start to finish of doing what I'm doing here.

  • So instead, I thought it would be interesting to try out kind of like a more or Indy style type video as well as at least towards the middle of may be the end.

  • What I can do is I can leave.

  • What I'm gonna try to work on here is scoring Chap Output, and I think I'm gonna do some very rudimentary scoring and then later kind of talk about next steps.

  • But then also, um, what I can do is kind of have an output of these chap bought outputs and then see if anybody can come up with some better ideas for scoring, of course, credit all given to anybody who does it if they do so.

  • Also on the note of content starvation.

  • Still, lots of people asking about neural networks from scratch.

  • Two things.

  • The videos.

  • My hope is to get them coming out sooner than I kind of had initially planned.

  • Just because again, I think so many people are kind of just stuck at home with nothing to dio.

  • And so so it would be nice to start putting out those those videos.

  • But if you are just dying for some content as a reminder, the draft for the book is is online.

  • Right now there's thousands of people with access.

  • If you pre order the book or even just the e book, you get access, usually same day access to that draft, and so you can read it.

  • You can highlight ask questions in line and so on.

  • So anyway, in that draft is basically everything from at the moment from, you know, coding a neuron to actually full forward past back propagation, actually training the model on, then coming out very, very soon is testing regularization like l one l two regularization and drop out.

  • So that is about to be pushed, probably within a week or so to the draft.

  • So anyway, definitely check those out and you can get access.

  • Like I said right now, Otherwise the video is my hope is soon, but I really don't know.

  • I really wanted to take my time on those videos and make them good, so I really don't want to rush them.

  • But I'm thinking of maybe moving some things around so we can kind of do those sooner than I had hoped.

  • So planned.

  • So anyway, back to what we're gonna do here.

  • What I've got is there's kind of so what?

  • This is is a chap pot, but it's based on the Googles and Mt, which is neural machine translation.

  • The kind of concept of Mt.

  • Was, or is to convert from one language to another, which is a highly complex task, especially depending on the language.

  • So something like converting, you know, English input to German or something like that.

  • What I thought of doing a very long time ago, though was.

  • What if we use it to English?

  • English?

  • So an English comment to an English response, And it turned out that actually kind of works.

  • It's definitely a hack.

  • I don't think this is how it was intended to be done.

  • But this is kind of what I've been playing with honestly years.

  • And so I really should just do something else with my time.

  • But I'm very interested in this concept.

  • So s so.

  • What we've been working with is Reddit Data.

  • So it's Reddit comments in responses.

  • If you there is a chap, a territory, if you go to Python permanent and just type chap by.

  • This is the same thing.

  • Basically, it's the MMT chap.

  • Now there's a couple of tweaks, but that's what we're dealing with.

  • So what?

  • The model that I've been training is a 20 total layers.

  • It's 10 layers encoder 10 layer decoder on the 1024 nodes per layer.

  • So just absolutely massive model.

  • And I've been able to do that with a batch size of like, I think it's at 1 28 right now, thanks to the two Artie X eight thousands.

  • So So, yeah, that that's the model.

  • I've been training, but I just can't get like, the perfect model.

  • So, like, you know, at Lets 100,000 steps.

  • The model answer some questions really well, but then still failed other questions.

  • And then at 120,000 steps, let's say answers those other questions that it wasn't answering well but then kind of screws up some other questions.

  • So then I started thinking, What if I treated this more like an ensemble where you take many models and you kind of put them together?

  • So historically, I've used ensembles in, like, a sort of voting classifier sort of way where you don't say you're trying to predict a class of a thing.

  • Yeah, it could be nice to have just one model, but almost always you do way better if you're willing.

  • Tohave like five models all predict, and then they run a vote on which class they think is most likely.

  • This tends to actually perform better than anyone model will, ever.

  • So then I was wondering whom well, you know, this isn't really a prediction.

  • It's not like a regression, necessarily.

  • But what I could do is just take all of the possible outputs and then take their scores or make new scores and then figure out which one of, like, really, what?

  • We could wind up with hundreds of outputs.

  • Then we can pick one is surely one of them is a good one.

  • Right?

  • So let me show you what a single model looks like, and then we'll jump into the ensemble.

  • So the ensemble code I had enlisted the help of Daniel because based on what I really wanted to do is have all these models running live at the exact same time.

  • Take that input, spit out the output and then make it really simple for me to start working with it.

  • So there's really no one better.

  • Definitely not mean to do that task.

  • So Daniel wrote this chap ensemble code, which, until I guess I'll put some input here.

  • Hello?

  • See if we get No, we don't get any output yet, but we'll just wait for that.

  • It'll come.

  • It will come.

  • Maybe also have Well, actually missed.

  • All the errors are gonna be output in the ensemble Could, um the way he sent it, Daniel sent it over.

  • It was silencing all the errors, but then I think actually opened it back up.

  • So we'll we'll probably see the errors.

  • I'm just waiting to see, like, a real air, but I think we're all set here anyway.

  • So while we're waiting for the single model tow run, Um, What?

  • I'm gonna I cannot hear it.

  • It sounds so good.

  • I should share.

  • I love the sound of a GPU at work a few times I've shared it.

  • I used to have it as my channel intro, and people literally complained about it.

  • Um oh, no.

  • Am I doing tyrant?

  • I think I ran trained.

  • Yeah.

  • Whoops.

  • I think I must have run trained.

  • I recognize that too much.

  • I meant to run Inference.

  • I've been constantly running train.

  • I think I was proud of what I did.

  • Flips.

  • Let me, uh, check.

  • Make sure that cleared out.

  • Memory good enough.

  • Okay.

  • Python.

  • Uh, inference.

  • Stup.

  • Well, okay, let's try that again.

  • I should That should have been my flag anyway.

  • Now wait for it to load.

  • Um, And while that's going and I've been severely disrupted, this is what you get with an orangey video.

  • My apologies.

  • People seem to like the Kaga one.

  • So anyway, I can't remember what I was talking about before.

  • Uh, Okay, so here's an example.

  • Output.

  • I literally said hello.

  • And this is the output it gives.

  • Let me zoom in for you guys.

  • Let's see how good you couldn't see that pretty good.

  • Okay, Um, how are you?

  • So that's obviously a terrible output.

  • And so the outputs, basically each chat bought model has I want to say it's called being.

  • I forget what it stands for, but you'll get to paying on how big your beam width is.

  • I think again.

  • It's been so long since, like we've had so many abstractions on top of the original and MT.

  • Code that I honestly forget.

  • But basically the model output 10 responses.

  • And in general, I want to say that default one chosen by the model is always the top response and then the pointing at it.

  • You can't see what I'm pointing it.

  • This here is a score that I believe mostly, Daniel wrote.

  • And again, this was written probably two years ago or a year ago.

  • I don't remember how he was scoring them, but there's some problems with score and then again, just like?

  • Well, I'd liketo have is possibly multiple scoring mechanisms.

  • And those could also be ensemble type method.

  • So anyway, as you can see, that was no good.

  • Let's try.

  • How are you doing?

  • Okay, I'm good, Thanks.

  • That's pretty good one, but and then you can see these other ones.

  • They're color coded by how bad they are.

  • So So this is the best one.

  • And then these air all kind of pretty bad.

  • As you'll see, they're just not finished sentences.

  • It's I'm good.

  • I'm just trying.

  • That's I'm good.

  • I'm just, you know, these aren't done, so we could use packages.

  • I'm not too familiar with Spacey, but I don't know if I mean saying that, right, But anyway, this it's spelled Spacey.

  • Um, I could try that.

  • I just don't know enough about that packaged enough.

  • If I could do but I'm thinking of, but I'm sure I can, But I know it with an L t k.

  • I could use an lt k to know.

  • Is this a complete sentence?

  • Is it a coherent thought?

  • So that would be a really good way to score outputs my curiosity's help quickly.

  • I could do that, but that will probably be the next step after I do when I'm thinking of doing today, because there are far easier ways to judge these outputs.

  • So one way that I'm pretty confident is actually included in this Daniel score that I'm gonna call it for that one is Does it end with punctuation?

  • So none of these end with punctuation.

  • One thing that I'm not sure is included, but I would like to include is any repetition.

  • So if you'd say, if it's like I'm good and then I'm something else, like, generally, those are pretty bad, like, just from what I've seen.

  • But we can continue.

  • Uh, what's your favorite?

  • Blue eyes?

  • Black and white, Black and black.

  • Okay, um, what?

  • Your job on the software is here.

  • Okay, these are pretty good.

  • I mean, this one's doing pretty good.

  • This is the This will be the largest, the latest model.

  • So this is the one that has been training the longest.

  • So as time is going on, this one is actually had pretty good responses.

  • But one of the things, like so just happily having a valid response and then having like a really thorough response, are like two totally different things.

  • So some of the models have had longer responses that were just really interesting responses, like three.

  • Not always the same, I guess.

  • Like a lot of times, the chap wants to gear itself.

  • Torrents.

  • Very short, quick responses.

  • So that's another thing.

  • I would like to kind of have some sort of length value as well length, but without repetition.

  • Okay, so something like that again, I'm just going to be trialling airing again.

  • This is just pure RND.

  • But then here, you can see Yes.

  • So, like, the problem here is Yes, it's long, but it's all repetitive.

  • Like we don't want repetitive stuff.

  • Um, yeah.

  • So I think you get the idea.

  • Uh, so So this is just one model, and we could continue asking questions, but, you know, some of them are good.

  • Some of them are bad.

  • Um, what's your GP?

  • Yeah, So I mean, like, these aren't This is pretty good.

  • I mean, that's not bad at all.

  • And like, really a lot of these air.

  • Pretty good responses.

  • Try to think of like a decent where do you?

  • I'm in Singapore, but these are pretty good responses to be honest.

  • I haven't really played with this model too much, but I know there are certain outputs that are not that great.

  • So, like, for example, um, there's our ensemble.

  • Let me go into No, um, would be model.

  • And then usually we can load by the latest clips.

  • Not that way.

  • This way.

  • There we go.

  • Sit in, like these are all just outputs.

  • Sorry, some of these air.

  • Not the nicest.

  • Also, this one was very short, because that's okay.

  • Yeah.

  • So, um, like, not all of these are very coherence.

  • You know, like this.

  • I don't even know what that's in response to.

  • It's a song, not a song.

  • That's I don't I don't really care what that's like.

  • These air just replies, So every new line is a reply.

  • Um, and like that, I don't like that one of these terrible replies, uh, what's alone?

  • Nice.

  • We'll check it out.

  • It's time to stop business, insider.

  • No.

  • When I upload these videos, I checked the box, not for Children.

  • I'm just saying Okay.

  • Anyway, so you least even in this one, we can see not all of these responses are ideal.

  • And obviously those were just responses, not even paired to the input.

  • So we don't even know if they were related to the input because sometimes the output is not even related to the input.

  • But I think we'll see that better when I do the ensemble.

  • So what I'm gonna do is go ahead and break this on.

  • Guess you'll just have to take my word for it that sometimes the responses were just bad.

  • Like Hello, So I'm gonna least that was one that would improve.

  • But when we do the ensemble, you will be able to see tons of stupid, stupid ones.

  • So ah, brief overview of the code for ensemble, or at least what's happening.

  • I'm not gonna go over the code.

  • It's not even my code again.

  • Daniel wrote this this section I made the request that he did it.

  • So what I have here is basically we are goingto run models.

  • This will be this is the number of steps in that model.

  • So we're going all the way up to 259,000 steps.

  • I believe that's the one we just looked at some of the outputs for and that's the one we were just running live in prints on.

  • But as the thing has trained, I've been watching outputs and these were kind of just as it was training.

  • I kind of liked some of the output.

  • So maybe they were very long.

  • Maybe had very unique outputs, Not a lot of repetition.

  • Good answers, funny answers, stuff like that.

  • I was like, Yeah, let's say that version.

  • So what we have here is to these got comments it out.

  • So it's a total of 22 of these 20 layers of 1024 nodes per layer models.

  • That's a lot of models, by the way, um, again, just running all those on the two or tea estate thousands.

  • Uh, okay, So basically, just it's gonna run all of these and pull it and it's any input we pass is going to basically inference against all of the models, and then we're just going to output all of that code now or all of the responses rather, So I'm gonna run in front stop pi.

  • But really, the code that we're gonna be modifying is this from sources model ensemble and then model ensemble.

  • We're gonna be modifying live ensemble inference later We can also generate a huge list of these responses using ensemble inference just here in either all either that way or via live ensemble inference or something.

  • What I'm thinking I can do is I can generate some example outputs and then share those unlike adjust or something like that.

  • That way, if anybody else has some ideas that they want to try to make their own kind of scoring mechanism, uh, you'll be able to and you can share it with us.

  • And again, I'll get full credit.

  • Anybody who has a good one.

  • Anyways, So, um okay, so we know what we're gonna do is we're gonna head into model ensemble and then this live ensemble inference code.

  • So we're gonna pop into sources model ensemble up high.

  • And he did.

  • Okay, So what's going on here?

  • Doesn't really matter.

  • Was being commented out here is all the errors that airs and warnings and just that kind of stuff.

  • So we're just not gonna look at that.

  • And then here is the code.

  • I'm just gonna zoom out a little bit.

  • Here's the code that we're going to be working with.

  • The first thing I'm gonna do is again.

  • This is not my code.

  • This is Daniel's code.

  • So because I'm gonna be mucking around, I'm gonna copy that whole thing.

  • And I'm just going thio save that for for the time when I inevitably screw something up, I'm gonna do my best to just coat around this code because it's just not mine.

  • But but, um, yeah, so it's going to say that And before we go too far, let's go ahead and run an example.

  • So let's back it up here and let's run infront stop by.

  • So Pike on Inference Stop.

  • I was gonna take a while for this.

  • We're going to see all this again.

  • We're seeing all this because I am not silencing all those warnings.

  • A man I can't tell you how many like clients I've worked with who we do like deep learning stuff with.

  • And even though these warnings aren't bad, they just they want them to go away like it.

  • Just certain people are just so bothered by output.

  • So if that's you, I you know, I apologize.

  • Also, let's just go ahead.

  • And I figured it was a capital H r.

  • Lower case H.

  • I don't think it matters, but I'm gonna just toss this in.

  • We don't have that symbol right now, but it was there.

  • It's way earlier, but all these warnings kind of gotten anyway.

  • I'm gonna hit.

  • Oh, it's already ready.

  • Well, so as you can see Hello.

  • What was the input?

  • I can start it lower case, but as you can see, there's a least one decent Hello, also, what's General can new?

  • That's in a lot of these.

  • I'm tempted to google it, But again, this is all from read it.

  • I'm sure that's totally benign.

  • Reference to something I just don't know about, uh, someone comment below.

  • That's ah, safe for work.

  • Okay, so this must maybe this is the one.

  • That's weird, because I'm almost I'm kind of seeing different responses that I swear we just saw.

  • Now I wanna check.

  • I'm sorry.

  • I just have to check.

  • Was that the latest to 54?

  • Oh, no.

  • Oh, because I'm moving.

  • So we have a 2 61,000 Okay, So this is it isn't the 2 61,000 model.

  • Maybe we should I might move back in the 2 60 ones that one actually had.

  • Okay, Outputs that least I saw initially.

  • But as you can see, even here, like, I'm not sure what the deal is with this score.

  • Daniel, Uh, really A lot of these, but as you can see, they're in there.

  • The good answers are all over the place in here.

  • We just have to find them.

  • So this is running all 22 months.

  • Where are you from?

  • I don't know.

  • I don't know if this mic is picking up that noise, but that is a wonderful noise.

  • I love that noise.

  • Where are you from?

  • I'm from New Zealand.

  • Fantastic response.

  • South Africa from England.

  • I'm from Australia.

  • Obviously, he doesn't know where he's from.

  • Hard.

  • You are beautiful machine electrical engineer on the software engineer.

  • It's funny because all of these are again.

  • This is already right.

  • So in theory, we should have a whole grouping.

  • But over time and as its bond through, read it clearly.

  • Software engineers, computer science and electrical engineers just like engineering.

  • Um, I guess that's what red it's for.

  • That I'm an engineering student.

  • Oh, here we go.

  • No, I'm an astronaut.

  • Okay, so some of these air cool.

  • A lot of them are terrible and so on.

  • So so one option is we could just take every response that has a pretty good high rating and then look further.

  • But, uh, I'm tempted to kind of start building my own, um, my own version of a score first.

  • And then we'll combine the two scorers and try to find good answers.

  • Because then we might also try to, you know, I might have a separate model that just looks for coherence.

  • And then we check, score stuff like that because the other thing is like a lot of times the emojis don't come through, at least in the Daniel score.

  • But I like them like you kind of want that, right?

  • So we did an emoji there.

  • At least this one is a proper one.

  • But here we choose just a bunch of pounds rather than emoji.

  • Um, yes, we're like missing a bunch like in here.

  • Why was it the colon?

  • I honestly don't know.

  • Like I said, that's not my my code.

  • Like the heart.

  • We don't get any of those, but like that's a really common one, especially to end on.

  • So when people end on emoji is a lot of times, they don't end on a proper punctuation.

  • So we want to handle for that.

  • But anyway, so now that we are this far, what we want to do is take this data and then maybe apply our own score to it just a station or working with it.

  • So we gotta gotta wrangle a few things together first.

  • So what I'm gonna dio is we're gonna come over here and basically every question that gets asked, we're gonna just build a big old dictionary.

  • That is, um really We just need the answers.

  • I'm not really sure I care for the score at the moment, but we'll go ahead and take answers.

  • Will make that a dictionary.

  • Um, I just want to make it a list or addict, but, um, I just believe it this way on.

  • And then basically, my hope for this dictionary will be Make sure this is Actually I think this is correctly sized.

  • I must have done it already anyway, if answers basically, my plan here is to be like answer score.

  • Here we go.

  • So, uh, this will be the d score for the Daniel score first, and then we'll kind of go from there.

  • So the first thing we have to figure out is where is it?

  • Um huh.

  • Um, comment below.

  • If you think this is a Pepe acceptable line, how long the line is?

  • Yeah, I think we could have some, like, formatting on that line, But okay, what we're after for I, in response, knew Marie for I and enumerate.

  • So actually, we're not looking necessarily like this is clearly one of them, but we're in numerator is we're probably grabbing index something over here if Champa answered.

  • So response scores, I So I'm gonna copy that.

  • And let's see if we can find response and then scores Bad response threshold response answers, I So that should be so.

  • The answer will be response answers at that index, and then the score is response scores a, uh, plural.

  • Bye.

  • So if responses none otherwise, uh, we're going to reiterate through them.

  • And then I am now going to save old so they answers.

  • Um, that's the scores were gonna say equals score Plural.

  • I feel like that should be score like, singular, but let's say school.

  • What was it?

  • Answer.

  • Answer.

  • It was answer not singular.

  • And then score was the plural.

  • But now I have to go figure that one out response.

  • Of course.

  • Okay, we'll find out we'll get in there if that doesn't work.

  • OK, so now we have built this, um, this dictionary that weaken, then when everything is done, hopefully come down here and begin working through, um, answers working through any sort of rules that we want to run on here.

  • But I think the smartest thing for us to do is to, like, print this once because we're gonna do a lot of r and D and running this over and over and over is gonna be a pain.

  • So it is a answers.

  • We'll just put that out.

  • Um, I'm trying to think of a good question.

  • Um, I'm gonna ask it.

  • I know.

  • Okay, I got my question.

  • I want something that's, like, somewhat challenging to answer, but okay, if answers okay, we're gonna say that and less hope.

  • Let's break this, and then we'll rerun it.

  • Ask our question, and then we should print out the full, um, full dictionary, and then we'll make a separate file to work with it.

  • And I think this is the sort of thing I can kind of share with you guys clearly these warnings and stuff.

  • How do you sleep?

  • It's still airing.

  • I want to ask you how it sleeps at night.

  • I'm just gonna ask you a quick question, and then we'll we'll get to keep their answer.

  • Oh!

  • Oh, the answer.

  • Answer, Answer.

  • Hold on, hold on.

  • Great.

  • Chapa answers if answers primate of some sort of stupid, stupid mistake.

  • But we just want that answer.

  • We get the score.

  • If it's the max, it'll be green otherwise.

  • And score response scores.

  • Response.

  • Answer first.

  • Oh, my is plural.

  • What, Are you kidding me?

  • It is plural.

  • Oh, and now I understand why the score was plural.

  • Okay, I'm following.

  • Okay, Okay.

  • Answers.

  • Because what good is a list of answers?

  • And that's at that index.

  • Copy that.

  • Okay.

  • All right.

  • We'll try it again.

  • Um, I'm just gonna run a quick hello just to get an output.

  • And then once we get our output, hopefully we'll have something that, like, this is why I want to hurry up and get that dictionary.

  • So then we can get away from working with this.

  • Here it It's going there She is beautiful.

  • Okay, so let's ask something.

  • How do you sleep at night?

  • There's a wonderful sound.

  • All of that noise.

  • Okay, so we have a big dictionary.

  • How do you sleep at night?

  • I'm drunk.

  • I'm sleep deprived.

  • I don't want a cup in the morning.

  • There's a lot of I don't wake up wake ups in the morning.

  • Variations of that.

  • That's kind of funny.

  • I don't wake up at night.

  • When I wake up, I wake up in the morning, and then that's a terrible one.

  • Okay, so, yes.

  • So what I'm gonna do is I'm gonna copy this entire dictionary.

  • Copy and well, come into here and I'm gonna say is Nana Tess, stop.

  • Hi.

  • I'm just gonna start Cool.

  • Now I've got a test up high.

  • Open that inside, Bloom.

  • And where s a in under scorer?

  • Answers equals, actually what is already this boom.

  • Okay, so I think answers For the record, I think I think this default still to the python to build.

  • I need to You said that thio again, this is a new machine.

  • So there's a lot of things I haven't properly set up yet.

  • So at some point especially by Jozef Strings or something.

  • I'm gonna need Thio not run this down here in the shelves.

  • Bare with me, OK?

  • Print Lynn.

  • So we have 100 and 68 answers.

  • How do we even begin to sort these answers?

  • Well, the first thing is, does it end on a punctuation or an emoji?

  • So, um, so one thing you could do is you can import string and then I want to say you can say Prince, uh, strained a punctuation run that and you can see here.

  • These are all available punctuation Sze.

  • I'm not gonna use that, though, mostly because a lot of times, for whatever reason, the chatbots likes to end on like I apostrophe.

  • So it, like, doesn't finish the I'm, um And I think that the thought has learned that you end on a punctuation and oftentimes the ending punctuation could acceptably, you know, you could have like, this is the end, right?

  • So, in theory, you could end on that upon that, like quote, I guess.

  • But anyway, um, as a problem.

  • So what I want to do probably is specify my own punctuation on my own, um, acceptable engines.

  • Okay.

  • And in this case, it could be it could be a single quote.

  • Uh, but I don't want that.

  • So I'm gonna say it could end on a double quote.

  • It could end on a period.

  • It could end with a smiley face, right?

  • Or, you know, El pending parentheses.

  • For whatever reason, Um, I'm gonna allow it to end on a three, for it has a heart.

  • That's a pretty common ending.

  • Um, obviously a question mark.

  • Exclamation mark on.

  • I guess we could look down here and see if we think there's anything else.

  • Um, here.

  • Do you have a period?

  • Yeah.

  • Okay.

  • Okay.

  • So, you know, I think that's good enough.

  • We might later add more to that.

  • But I think for now, um, those will be acceptable endings.

  • The other one would be maybe some sort of like emoji.

  • You know, that might be a thing that happens.

  • So I don't know if I want to include that or not.

  • Because the original Charles Chaplin, um out of nowhere, we'll use even discord.

  • Emojis, which was kind of shocking because there's no a boat like it's trained on Lee on Reddit.

  • And yet it used some discord emoji is like, if you do, like a beer clip planking the moody or whatever.

  • You know, uh, look at cheers.

  • It'll do.

  • Cheers back.

  • I don't know how I learned that, but Okay, so maybe that I don't know.

  • Anyway, I'll allow it for now, especially because I guess sometimes people do those backwards.

  • Smiley's right.

  • So you could say like that, right?

  • So we'll allow it for now.

  • Okay, that's an acceptable ending.

  • So now we're gonna say is four.

  • Answer in in answers.

  • If, um if ants negative one in acceptable endings, uh, prince ants.

  • And I'm gonna go ahead and use the full answer.

  • Just so the Silver Knight jerk answer.

  • Uh, just so we're not using to shorthand, cause this is probably gonna get messy pretty quickly.

  • So let's go ahead and print.

  • Answer.

  • So these are all answers.

  • That and I just thought a TTE some point, I'm probably going to score, said you guys don't let me forget.

  • I'm gonna score things, and then we're gonna, at some point try to sort this dictionary and because this is python to will.

  • That sort I guess we could use a sword addict, but I refused.

  • So so then I'll have to start running it in the interpreters.

  • Er, er, like in the terminal.

  • So hopefully I don't forget that.

  • So these are all acceptable ending answers.

  • At the moment, I'm sleep deprived, and I'm not awake yet.

  • I've been sleeping for a few days.

  • You can't wake me up.

  • I'm awake.

  • I'm awake now.

  • Um, so maybe that's the next thing I would fix.

  • So eso repetition is both repetition.

  • And how many times the aye aye uses the word I I especially isa problem.

  • So the next thing I'm gonna say is lowered answer equals answer dot lower.

  • So this will kind of normalize everything just in case.

  • In this case, the sentence starts with I'm, but sometimes it won't.

  • So you might have, like, one word that just it's at the beginning of the Senate, so it gets capitalized, and then the other word is lower case, and then we think, Oh, there's no match, but there is match, so we're just gonna normalize everything by lowering it.

  • And then basically, what I want to know is, uh, four before were No, I guess we call this words and then that will equal.

  • Um, I guess we could split Bice base and then trend.

  • I don't know.

  • Let's say our strip brother, I don't strip.

  • There's got to be a better way than this again.

  • If you were using lt k on first base, if you could just say, like, token eyes, Okay.

  • And it would do this, but this is okay.

  • Um, I stripped before I end.

  • Were in lower answer dot split buying.

  • It's large words.

  • Cool.

  • Um, let's go ahead and pretty words, and I'll just break here when I'm looking.

  • Wake up.

  • I wake up feeling like I'm doing.

  • Okay.

  • Uh, that really Okay?

  • Yeah, I just had Copy that.

  • Um, let's also set a flag.

  • Acceptable.

  • Acceptable end equals false.

  • And then, if it has an acceptable ending, will say acceptable.

  • Um, uh huh.

  • It should be worth something, I guess if it ends on a punctuation, so I'm gonna say zero.

  • Um, and then we're gonna say, acceptable.

  • And if it has one?

  • Well, say that's equal to Maybe we'll have a constant up.

  • Here was just a, um, accepted, acceptable and bow.

  • Also, the five for now, eventually will put this all into some scoring formula, so that definitely worked.

  • At least then we're going to say words I don't want to require necessarily that it has that if we did, we could just have everything over, I suppose.

  • But I'm not sure I want to require everything has that, But we could, um So instead of, you know, at the moment, the score is basically zero Well, I'll leave it for now.

  • I don't think I want to do that, so I'm going to say that.

  • But So Okay, so we have words printed words so that when we want to do is four delic for word in words.

  • Uh uh, discount.

  • I guess we'll be equal to words.

  • Got count.

  • Word if C is greater than one.

  • Um, let's add up here.

  • RePet shins equals zero repetitions equals zero.

  • And then if it's greater than one or two say is repetitions plus equals, um, C minus one.

  • Because we obviously don't want it killing.

  • So, like, if they say i twice, it should just be like, Okay, you got one repetition.

  • But if they say I three times okay, you get two repetitions.

  • So now we're gonna say Are we still breaking?

  • Yes, So now we're gonna say is pretty repetitions.

  • Four.

  • When?

  • Okay, Wake and wake.

  • I and I open up.

  • Right.

  • But also, I missing when I wake up.

  • Um, yeah, I guess we're gonna do this.

  • Do you print work?

  • Right.

  • So I went Oh.

  • Okay.

  • So it hits it twice because it got back to that other word I see.

  • Soon I'm gonna let it go, so we'll just kind of be dumbbell penalized, but it's all gonna pour into a formula.

  • So it's still going to scale the nearly as I intended to.

  • So, you know, basically at the end, you could divide repetitions by two if you want it to be perfect, but yeah, well, if I had to sit on that for a few seconds, dummy.

  • Okay, so we have repetitions.

  • We have, um so at this point, we could already begin scoring something.

  • So another decent, I think, is the length.

  • So as long as there's not repetition, the length is actually good, like the longer it is, because again, the chapel tends towards really short, um, short responses.

  • And I think that's just because in the chat about itself, the Maur words that it gets like wrong, the more it's going to be penalized like the lost function.

  • So I think that's why it tends toward short responses.

  • So the times where the chap produces long response is a lot of times those air like, really cool responses.

  • That's why I want more of those because it's it's cool when it's a very long response.

  • This line is it's a good one.

  • So, um mmm mmm mmm.

  • So now let's do length.

  • So for answer and enough answers, basically, length should be cancer.

  • Length will be equal to lend words.

  • So we have length, we've got repetitions, and we've got acceptable ending.

  • So at the very beginning, what we could say is like, we could make a really rudimentary scorer so we could just say, um I'm gonna call H store because later we might have a D score.

  • So a score will be equal to, um let's say answer length.

  • So should be I'm gonna put this in answer length.

  • Um, answer length.

  • I'm trying to think if there's anything else plus, um, acceptable end, Val, I guess length it could either be plus or maybe like times two or something.

  • I don't know, I'm just I'm just making this up right now.

  • So answer length plus acceptable end, right?

  • Is that the acceptable end?

  • Um, yeah.

  • And then what I'll do is divide it by divided by, um, repetitions.

  • Repetitions.

  • Okay, so there's our age score.

  • Let's go ahead and print.

  • H score scored.

  • So this gives it a two.

  • But I think over time, we're gonna need wait.

  • Like we need to know more scores.

  • So now what I want to do is stop the print there.

  • I just want to score.

  • Thank you.

  • Okay.

  • You think about how we're gonna do this now?

  • Um, each scores, um, and they will have cancer scored.

  • Right?

  • That'll be hell.

  • We're gonna structure that.

  • So we will now?

  • Yeah.

  • So was a H scores.

  • Answer equals each score up.

  • I think that's good.

  • And then at the analyst print, uh, scores.

  • So then what we need to do is stop the break.

  • We run it, divide by zero.

  • Of course, that has no repetition.

  • You're gonna have a problem.

  • Positions, Do we Okay.

  • We'll just start repetitions as a one.

  • Done.

  • Okay, So now, now we have, um, quite the list.

  • And now what we want to do.

  • I've been sleeping for a few days.

  • Um, okay, so now we want to do is possibly now we need to sort it.

  • So I don't know, man sorting dicks.

  • And then you basically want us to sort the dictionary and then, like, maybe go in reverse order or something, So I don't know what the top of my head.

  • So we're gonna We're gonna grab the old Google sort dictionary by values sort addiction values.

  • Python.

  • You have already searched this on here.

  • Cool sword.

  • A dictionary by value.

  • Yeah.

  • You want the output as addict.

  • So one let's just grab this and we'll see what this does.

  • And then the other thing we want is the max dicked value as well.

  • So, um well, actually, we'll just do that down here, So we're gonna say sorted H scorers equals keeper value for key value in h scorers dot items.

  • So then Brandt print sorted h scores.

  • Oh, yeah.

  • I can't do that.

  • Um, yeah, it's not gonna work.

  • Uh, let's go.

  • We'll run this in.

  • Terminal point on expired now, So fight on test stop.

  • Hi.

  • Cool.

  • So here is actually sorted.

  • How we intended to be sorted.

  • Um, how do you sleep at night?

  • I'm not a interesting.

  • So some of these other ones, I'm not a I wake up.

  • I don't wake up in the morning.

  • I wonder why that was ranked.

  • Okay, these are all nines.

  • And then finally, at the end, we get a wake up in the morning, thirsty?

  • And how come I can't see it?

  • I swear that's not giving me me.

  • Because I resized it in the world is like, not seen.

  • Or maybe I'm blind.

  • Anyway, when I wake up, I'm going to sleep.

  • When I wake up, I'm going to sleep at night.

  • I've been awake for a few days.

  • I don't think so.

  • Like at the moment when I look at this, I wonder you know why?

  • You know this one is only ranked better than the other ones because it's longer.

  • But when I wake up, I'm going to sleep at night versus I don't wake up.

  • So the duras mean those?

  • I would say I think I think what we want to do this may or may not work, but one of the things I'd be curious about is an account so I count equals zero and either weaken subtract it at the very end.

  • Or we could add like I count to what we're dividing here.

  • Just depends on how much we want to punish for the I count.

  • So the next thing that we're gonna dio is, I guess here I don't know.

  • Um, in fact, um, cut This paste I count equals answered.

  • I count the number of times a capital I occurs, and then we'll take account, and I'm gonna put it down.

  • Repetitions read it were really paralyzed for I can't, so we'll save that.

  • Uh, come back over here.

  • You can't wake up.

  • Mmm.

  • One eye is okay.

  • Maybe we'll news.

  • I count.

  • Let's do I count minus one.

  • I can answer much example.

  • Only kill it just because it had one eye minus one shoot.

  • I can't think because I don't want to be in it.

  • I don't want to be a zero.

  • I guess it would be zero, no matter what.

  • If there's no, I really like one.

  • I I want to be acceptable, like one or zero eyes, like one or zero eyes is okay, but more is not.

  • And so what I can't decide is so zero.

  • I can't.

  • Can I just say if my brain is not happy anymore?

  • If I count is less than zero, right, Because if it zero, it becomes a one, then we're going to say I can't equals zero.

  • And I guess well paid that.

  • That's the kind of line that I really wish was acceptable for me to just leave on one line, though, Uh Okay.

  • So run.

  • I don't wake up in the morning.

  • I've been awake for a few days.

  • I've been sleeping for a few days.

  • Okay, so all three of those were rain.

  • 12.

  • So that's not bad.

  • Um, there have been at all.

  • So if we did, um, let's say get get it, Max, get keep get key for a Max Valley Value Python dictionary.

  • Then my internet is going so slow.

  • The key.

  • Oh, you also probably see that getting key with maximum value and dictionary lever.

  • The other thing I want to do possibly get Can I owner because it has its days ordered.

  • I don't even know.

  • Um, can I do this Grant?

  • I don't know.

  • It's embarrassing that I don't know, but let's just try that.

  • I bet it won't work in 27 because there is no order.

  • But I wonder if it works here.

  • No, I can't.

  • Hash.

  • Okay.

  • I can't slice it.

  • Um, what if you What if we convert it to a list?

  • I still want to know, Like, can I?

  • Because I know we could do that Max thing.

  • Okay, I know we could do the Max thing, but sometimes I want to get, like, just the top end responses.

  • Like, I don't want just the top response.

  • Like I'd like to work with what are the best ones we think we have so far and then kind of go from there because doing things like, Is this a funny response, or is this coherent Means we're gonna have to use something like Spacey or N L T.

  • K.

  • Doing that on all of the responses will take a while, but if we can kind of filter out a lot of responses first, that won't take his long, same thing if I end up trying to use some sort of deep learning algorithm to analyze a sentence and determine is this, you know, funny or sarcastic, or is this like a good response or not, the less we have to go through the better.

  • So I wouldn't mind being able to take, like, a top end.

  • So?

  • So I wonder if I could just say print que for K in sorted H scorers.

  • Negative five.

  • Can I do that?

  • We don't Let me do it.

  • Okay.

  • Um, I think this is right.

  • I don't wake up in the morning.

  • I've been awake for a few days.

  • I've been sleeping for a few days.

  • I don't wake up at night.

  • And another answer.

  • How do you sleep in it?

  • That's a funny one.

  • Like, I don't know.

  • Yeah.

  • Okay, so that's one way that we could get a handful and then otherwise, we can get just like the top one using Hopefully this will see what happens.

  • Max, Stats key.

  • Where is our addict?

  • Okay, so that's how we can d'oh maybe get a slice of the best again.

  • This requires python 3.6 plus or sort of.

  • So if you don't, If you're on tight onto you can, like from collections import sort addict, I want ordered dicked rather.

  • Um, yeah.

  • Okay.

  • Also Max of Well, that's interesting.

  • I didn't know you could. 00:52:35.090

what's going on?

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

A2 初級

ディープラーニング・チャットボットの研究開発 (Deep Learning Chatbot R&D)

  • 3 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語