Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 13
How to use GphaHoa/academic_all_mpnet_base_v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("GphaHoa/academic_all_mpnet_base_v2")
sentences = [
"Congruence of Triangles. Triangles. Maths. CBSE 9. CBSE Content - Final. CBSE. ",
"Expressing Multiplication Sentences Practice. . ",
"Prove R-H-S criteria for congruence of triangle. . ",
"DNA. . I'm sure many of y'all have already heard of the molecule DNA, and it stands for deoxyribonucleic acid. I wrote it out ahead of time to spare you the pain of watching me spell this in real time. But it is-- and I think you already have an idea. This is the basic unit of heredity, or it's what codes all of our genetic information. And what I want to do in this video-- because I think that's kind of common knowledge. That's popular knowledge that, oh, everything that makes my hair black or my eyes blue or whatever, that's all somehow encoded in our DNA. But what I want to do in this video is give you an idea of how something like DNA, a molecule, can actually code for what we are. How does the information, one, get stored in this type of a molecule, then how does that actually turn into the proteins that make up our enzymes and our organs and our brain cells and everything else that really make us us? So this is a computer graphics representation of DNA, and I'm sure many of y'all have heard of the double helix. And that's in reference to the structure that DNA takes. And you can see here it's a double helix. As you can see here, you have two of these lines, and they're intertwined with each other. You see there, that's one of them, and then you see another one intertwined like that. And then they're connected by-- you can almost view it as like these bridges between the two helixes, and they twist around each other. I think you get the idea. So the double helix just describes the structure, the shape that DNA takes, and it leads to all sorts of interesting repercussions in terms of how heredity takes place and how natural selection and variation might take place as well. And actually, in the future, I do want to actually read with you Watson and Crick's paper on the double helix where they essentially talk about their discovery. The best thing about that paper, besides the fact that it was probably one of the biggest discoveries in the history of mankind, is that the paper is only a page and a half long, and it goes to my general view that if you have something good to say, it shouldn't take you that long to say it. But with that said, let's think a little bit about how this can actually generate the proteins and whatever else that make up all of us. So right here this is a zoomed-up version of that graphic that I just showed you a little bit earlier, and this is each of the helixes. So if this is the magenta side, if you unwound this helix-- right now it shows it in its wound state, but if I unwind this helix, one side would maybe be this magenta side of our helix and then one side is this green side, right? And if you twist it up, you get back to this drawing up here. And then these bridges that you see in this drawing in the double helix, those are these connections right here. These are the bridges. Now, what allows us to code information is that the blocks that make up the bridges are made of different molecules. And the four different molecules that are made up in DNA are adenine-- and it's written here on this little chart. I got all of this from Wikipedia, so if you want more information I encourage you to go there. Adenine, that's up here. This is the molecular structure of adenine. It's connected to a sugar right here, ribose. I won't go into a deoxyribose. And then you have your phosphate group. But these kind of form the backbone of the DNA: the sugar and the phosphate groups. And I'm not going to go into the microbiology of it, because that's not important right now to understanding just how does this intuitively code for what we are. So along the backbone, which is identical, and we'll talk about it. They run in different directions. It's called antiparallel, so they label the ends. And I'm not going to go into detail there, but the important thing are these bases here. So you have adenine, and adenine pairs with thymine, and you see that up here. If you have an adenine molecule here, an adenine base here, it'll pair with thymine, and this is called the base pair. Adenine and thymine pair with each other. If you have thymine, it's going to pair with adenine. And then you have guanine and it pairs with cytosine. And the names of these, you should know these names, just because they are almost-- well, if you ever enter any discussion about DNA and base pairs, this is expected knowledge. But the names of the molecules and how they're structured, not important just yet. But what's important is the fact that there are four of them and that they essentially code information. So you can view one of these strands in kind of a simplified way. You can just view it as a strand of-- so this one, if it has an adenine and then it has a cytosine, then it has a guanine. That's a guanine. They did it in purple. And then it has a-- oh, no, it has a thymine, not a guanine. So it has a thymine in purple, and then in blue, it has a guanine. So this strand right here codes ACTG. And if you were to code the opposite side of the strand, you could immediately-- I don't even have to look here. I can look at this side and say, OK, adenine will pair with thymine, cytosine pairs with guanine, thymine pairs with adenine, and guanine pairs with cytosine. So they're complementary strands. So if you think about it, they're really coding the same thing. If you have one of them, you have all of the information for the other. Now, in our DNA, in a human's DNA, you might say, hey, Sal, how do I go from these little chains of these molecules? How does that turn into me? How does that turn into this complex organism? And the simple answer is, well, the human genome has three billion of these base pairs. And that's actually just in half of your chromosomes. And I'll tell you, maybe in this video or a future video, why we only consider half of your chromosomes, and that's because essentially you have a pair of every chromosome. I'll talk in more detail about that. And this number, to some people, they might say, it only takes three billion base pairs to describe who I am? And some people would say, wow, it takes three billion base pairs to describe who I am. I never thought I was that complex. So depending on your point of view, this is either a large or small number. But when you take these three billion base pairs, you're actually encoding all of the information that it takes to make in this case a human being. And actually it turns out a lot of primates don't have that many different base pairs than human beings. The amazing thing is even things like roundworms and fruit flies also number in a surprisingly large fraction of the base pairs of a human being. Maybe I'll do another video where I go into comparative biology. But how do these base pairs actually lead to proteins? I mean, it's fair enough. That's information. It's like you can view these as ones and zeroes in some type of computer language, but really they're not just ones and zeroes, because they can take on four different values. They can take on an A, a T, a C or a G, so you could think of them as zero, ones, twos and threes, but I won't go into that whole aspect of it just now. So how does that actually code information? So DNA when it actually transcribes something-- the process is called transcription, and I'm going to do a pretty gross simplification of it, but I think it'll give you the gist of how it codes for proteins. So what happens when transcription happens is that these two strands split up, and one of the strands-- let me just take one of them. Let's say it looks like this. I'll do it all in one color. Let's say it's just ATGGACG-- I'm just making up stuff-- TA. Let's say that that's the strand that got split up. And what happens is it transcribes-- and I won't say itself. There's a whole bunch of enzymes and proteins and a whole bunch of chemical reactions that have to happen, but this DNA essentially transcribes a complementary mRNA. And I'll introduce RNA. It's essentially the exact same thing as-- well, the word is ribonucleic acid, so it's literally-- you get rid of the deoxy, so you can kind of say it's got its oxy, and it's ribonucleic acid, but it's very similar to DNA. It codes in the exact same way. The only difference between RNA, instead of a thymine, it has something called a uracil. So every place where you would have expected a thymine, you would have expected a T, you'll now see a U. So, for example, if this is the DNA strand, then an RNA, an mRNA, in a messenger RNA strand, will be built complementary to this. So it'll be built-- let's see. With A, you'd normally have thymine when you're talking DNA, but now we're talking RNA, so it'll be a uracil, then an adenine, cytosine, cytosine, uracil, then we got a guanine, a cytosine, an adenine, and then we'll have a uracil. So this is the mRNA strand here. And all of this is occurring inside the nucleus of your cells. And we'll do a whole series of videos in the future about the structure of our cells, but I think most of us know that our cells-- and I'll talk more about eukaryotic and prokaryotic organisms in the future, but most complex organisms, they have a cell nucleus where we have all of our chromosomes that contain all of our DNA. And so this mRNA then detaches itself from the DNA that it was transcribed from, and then it leaves the nucleus, and it goes to these structures called ribosomes. I'm oversimplifying it a little bit, but at the ribosomes, this mRNA is translated into proteins. So let me do that. So let's say this is the mRNA. It was transcribed from that DNA, so let me get rid of that DNA now. I got rid of the DNA. This is the mRNA that we were able to transcribe from that DNA, and they have these other things called tRNA or transfer RNA. And what these are-- and this is the really interesting part. So you may or may not know that pretty much everything we are is made up of proteins. And these proteins, the building blocks of proteins are amino acids. And for those of you who like to lift weights, I'm sure you've seen ads for amino acid supplements and things of the like. And the reason why they talk about amino acids is because those are the building blocks of proteins. My son actually has an allergy to milk protein, so we had to get him a formula that was just pure amino acids, just all of the milk proteins broken down. So if you look at a protein, it's actually a chain of these amino acids and usually a fairly long chain. We'll look at some protein structures in the very near future, just to give you an idea of things. It's a very long chain of these amino acids, and there are actually 20 different amino acids. Twenty different amino acids are pretty much the structure of all of our proteins. Let me write that. So a very obvious question is how can these things code for 20 different amino acids? I can only have four different things in this little bucket right here. And then you just have to go back to your combinatorics, or if you can't go back to it to watch the playlist on probability and combinatorics, and say, OK, there's only four ways that I can have for each of these bases. There's only four different bases that I can have here, either an adenine guanine, cytosine or, depending on whether we're talking about DNA or RNA, a uracil or a thymine. But how can we increase the combinations? Well, if we include two of them, if we include two bases, then how many combinations can we have? Well, we have four possibilities here, then we'd have four possibilities here, so we'd have 16 possibilities. But that's still not enough. That's still not enough to code for one of 20 amino acids to say, hey, this is going to code for amino acid number five, and we'll talk more about their actual names. So what do we have to do? Well, we have to use three of them. So three of them, there's actually four times four times four possibilities here, so they could code for 64 different things. They could take on 64 different combinations or permutations, this UAC right here. So if we have three of these bases, we can actually code for an amino acid. Actually, it's overkill, because we can actually have 64 combinations here, and there are only 20 amino acids, so we can even have redundant combinations code for different amino acids. For example, we might say that, and this isn't the actual code, but maybe UAC, and I should look these up. This codes for amino acid number 1. And if it was AAU, then this codes for amino acid number 2. And if I have-- I mean, I think you get the idea. If I have GGG, this codes for amino acid number 10. And what happens is when this messenger RNA leaves the nucleus, it goes to the ribosomes, and at the ribosomes-- we're going to look at that diagram in a few seconds-- but at the ribosomes-- let me take my same mRNA molecule. And they're much longer than what I'm showing here. This is just a fraction of an mRNA molecule. So I'll take my mRNA molecule, and what they do is they essentially act as a template for tRNA molecules. And tRNA molecules are these molecules that are attached to the-- they're almost like the trucks for the amino acids. So let's say I have some amino acid right here, and then I have another amino acid that's right here like that, and then I have another amino acid that's like that. They'll be attached to tRNA molecules. So let's say that this tRNA molecule has on it-- so this amino acid is attached to a tRNA molecule that has the code on it A-- let me do it in a darker color. It has the code AUG. This one right here has the code-- let me pick another one. Let's say it has GGAC. So what's going to happen? When you're in the ribosome, and it's a complex situation, but actually what's happening isn't too fancy. This tRNA, it wants to bond to this part of the mRNA. Why? Because adenine bonds with uracil, uracil bonds with adenine, and guanine bonds with cyotsine, so it'll pull up right here. It'll pull up right next to this thing, and actually, I should probably-- well, I don't know if I can rotate it. But it'll just pull up right here and attach to this mRNA molecule. And this right here is tRNA. This is mRNA. And the names don't matter. I really just want to give you the big picture idea of how the proteins are actually formed. And this is an amino acid. I don't know, let's call it amino acid 1, amino acid 5, amino acid 20. This guy, he's going to pull up right here. The guanine is attracted to the cytosine, and if you watch the chemistry videos, these are actually hydrogen bonds that form the base pairs. Adenine, wants to pull up to uracil, cytosine to guanine, and so on and so forth. And so once all of these guys have pulled up-- let me do that. So once you've pulled up, let's say that this is-- I could do it up here. This is my mRNA molecule. I'm not going to draw the specifics right there. My little tRNA's pull up, pull up next to it, and they each hold a payload, right? So this first one holds this payload right here of this amino acid. The second one holds this payload of this amino acid and so forth and so on. And so it might keep going, and there's another green amino acid here. They really don't have those colors, but I'm just-- just for the sake of simplicity like that. And then the amino acids bond to each other when they're held like that close to each other. This doesn't happen all by itself. The ribosome serves a purpose, and there are enzymes that facilitate this process, but once these guys bond together, the tRNA detaches, and you have this chain of amino acids. And then the chain of amino acids starts to bend around so they have all of these-- and it's actually a fascinating-- I mean, people spend their lives studying how proteins fold, and that's actually where they get most of their structural properties. It's not just the chain of the amino acids, but what's more important is how these amino acids actually fold. So once you fold them, they form these really ultracomplex patterns based on what amino acid is attracted to what other amino acid in these very intricate three-dimensional shapes. And what I took here from Wikipedia is these are some amino acids. And just to be able to relate this to the DNA, this right here is insulin. It's key in our ability to process glucose in our body. So this right here is insulin. It's a hormone. So sometimes you hear people talk about your immune system. Sometimes you hear people talking about your endocrine system and hormones, sometimes your digestive system. This is hemoglobin, what essentially transports our oxygen in our blood. But all of these things are proteins, and all these little, little folds you see, these are all little amino-- I mean, they're just little dots of amino acids. Some of these are multiple chains of amino acids kind of fitting together like a big puzzle, but some of them or just single chains of amino acids. For insulin right here, this is 50 amino acids. And then once the chain forms, it all bundles together and forms this little blob like you see, but the shape of that blob is super important for insulin being able to perform the function that it needs to perform in our systems. But this right here is approximately 50-- I forgot the exact number-- amino acids. This right here, this immunoglobulin G, which is part of our immune system, this is roughly 1,500 amino acids. So how much DNA or how many base pairs had to code for this? Well, three times as much, right? Because you have to have three base pairs that code for one amino acid, and actually, three base pairs, this is called a codon, because it codes for amino acids. So three base pairs make a codon. So if you have 50 amino acids that make up insulin, that means you're going to have to have 50 codons, which means you have to have 150 bases or 150 of these A's and G's and T's. If you have 1,500 amino acids, that means you're going to have to have 1,500 codons, which means you're going to have roughly 4,500 of these base pairs that code for it. Now, there are some notions that get confused a lot, so I went to kind of the smallest level of our DNA right here, and this is the level at which-- well, this is RNA that I'm pointing to right there, but this is the smallest level of DNA, and that's the level at which the information is actually coded. But how does that relate to things like genes and chromosomes and things that you might talk about in other contexts? So let's say the 150 base pairs that coded for insulin, these make up a gene. And these 4,500 base pairs make up another gene. Now, all of the genes don't make proteins, but all of the proteins are made by genes. So let's say I have just a bunch of-- I'll just make another A, G, and it goes down, down, down, and you have a T and then a C and a C, and let's say I have 4,500 of these. These could code for a protein. These could code for protein, or they could have all of these other kind of regulatory functions telling what other parts of the DNA should and should not be coded and how the DNA behaves, so it becomes super, super complex. But this kind of section of our DNA, this is what we refer to as a gene, and a gene can have anywhere from a couple of hundreds of these base pairs or these bases to several thousand of these base pairs. Now, a gene is that part of our chromosome that codes for a particular protein or serves a certain function. Now, there are different versions of genes. It's a gross oversimplification, but let me say this is the gene for insulin. Now, there might be slight variations in how insulin can be coded for, and I'm kind of going out of my domain right here, because I don't know if that's true. And maybe I shouldn't just speak specifically about insulin, but it's coding for some protein, but there's maybe multiple different ways that that protein can be coded. Maybe instead of a T here, sometimes there's a C there. It still codes for the same protein. It doesn't change it quite enough, but that protein acts just a little bit different. It's a slight variant. I'll use that word. Now, each variant of this gene is called an allele. It's a specific variant of your gene. Now, if you take this DNA chain, and this chain over here-- let's see. This is one base pair. This might be like one base. This is another base. Maybe this is an adenine and then this would be a thymine over here in green. This is an adenine and this would be a thymine. If right here this is a guanine, then right here would be a cytosine. This would be just a very small section. If I were to like zoom out, and let's say we have a big chain of DNA where each of these little dots are a base pair that I'm drawing here, maybe this section codes for gene 1. And then there's some noise or things that we haven't fully understood yet. Now, I want to be clear. Just with a simple discussion of DNA, we're already kind of approaching the frontiers of what we know and what we don't know, because DNA is hugely complex, and there's all of these feedback structures, and certain genes tell you to code for other genes and not to code for other genes and to code under certain circumstances, hugely complex. So there's huge sections of DNA that we still don't understand what exactly they do. But then maybe they'll have another section here that codes for gene 2. Maybe gene 2 is a little bit longer. Maybe it's 1,000 base pairs. But when you take all of these and you turn it into a-- it kind of winds in on itself like this. Let me do it. So it'll wind up, winding in on itself like this and do all sorts of crazy things. Remember, it completely bundles itself up, and then it looks something like that. Then you get a chromosome. And just to get an idea of how large a chromosome is compared to the actual base pairs, chromosome number one in the human genome-- so we have 23 pairs. If you look at it inside of a nucleus-- so let's say that's the nucleus. Let's say this is the cell. The cell is much bigger than what I'm showing. But we have 23 pairs of chromosomes. I won't do all of them. You can actually see chromosomes in a not-too-expensive microscope, so we're already getting to a scale that we can start to look at. But the largest chromosome, which is chromosome number one in the human genome, just to give an idea of how much information it's packing, that thing right there has 220 million base pairs. Sometimes people talk about chromosomes and genetics and genes and base pairs interchangeably, but it's very important to kind of get an idea of scale. These chromosomes are a super-long strand of DNA that's all configured and bundled up, and it contains 220 million base pairs. So the actual elements that are coding for the information are unbelievably small relative to the chromosome itself. But now that we understand a little bit, and actually I want to take a look back at this, because this kind of blows my mind, that if you just take those little combinations of those amino acids, you can form these very intricate, very advanced structures that we're still fully understanding how they actually interact with each other and regulate how all of our biological processes work. And what's even more amazing is that this scheme that I've talked about in this video about DNA to mRNA to tRNA to these molecules, this is true for all of life on our planet, so we all share this same mechanism. Me and this plant, we share that common root that we all have DNA. As different as me and that roach that I might not like to be in the same room, we all share that same common root of DNA and that all of it codes to proteins in this exact same way, that there's this commonality amongst all life. That, to me, is mind blowing. Then even more mind blowing is how these very complex shapes are formed by the DNA. And this isn't speculation. This is observed behavior. This is a fascinating structure right here, but it's just based on 20 amino acid-- you can almost view the amino acid as the LEGOS, and you put the LEGOS together, and just the chemical interactions form these fairly impressive structures right here. So now that we know a little bit about DNA and how it codes into protein, we can take a little jump back and talk a little bit more about how variation is actually introduced into a population. "
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model trained. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: MPNetModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'Determining Unknown Angles in Complex Composite Figures. Triangles. Geometry. Grade 4. Elementary Math. Math. K-12. ',
'Determining Unknown Angles in Complex Composite Figures. . ',
"Initial value & common ratio of exponential functions. Get comfortable with the basic ingredients of exponential functions: the\nInitial value and the common ratio.\n\n. - [Voiceover] So let's think about a function. I'll just give an example. Let's say, h of n is equal to one-fourth times two to the n. So, first of all, you might notice something interesting here. We have the variable, the input into our function. It's in the exponent. And a function like this is called an exponential function. So this is an exponential. Ex-po-nen-tial. Exponential function, and that's because the variable, the input into our function, is sitting in its definition of what is the output of that function going to be. The input is in the exponent. I could write another exponential function. I could write, f of, let's say the input is a variable, t, is equal to is equal to five times times three to the t. Once again, this is an exponential function. Now there's a couple of interesting things to think about in exponential function. In fact, we'll explore many of them, but I'll get a little used to the terminology, so one thing that you might see is a notion of an initial value. In-i-tial Intitial value. And this is essentially the value of the function when the input is zero. So, for in these cases, the initial value for the function, h, is going to be, h of zero. And when we evaluate that, that's going to be one-fourth times two to the zero. Well, two to the zero power, is just one. So it's equal to one-fourth. So the initial value, at least in this case, it seems to just be that number that sits out here. We have the initial value times some number to this exponent. And we'll come up with the name for this number. Well let's see if this was true over here for, f of t. So, if we look at its intial value, f of zero is going to be five times three to the zero power and, the same thing again. Three to the zero is just one. Five times one is just five. So the initial value is once again, that. So if you have exponential functions of this form, it makes sense. Your initial value, well if you put a zero in for the exponent, then the number raised to the exponent is just going to be one, and you're just going to be left with that thing that you're multiplying by that. Hopefully that makes sense, but since you're looking at it, hopefully it does make a little bit. Now, you might be saying, well what do we call this number? What do we call that number there? Or that number there? And that's called the common ratio. The common common ratio. And in my brain, we say well why is it called a common ratio? Well, if you thought about integer inputs into this, especially sequential integer inputs into it, you would see a pattern. For example, h of, let me do this in that green color, h of zero is equal to, we already established one-fourth. Now, what is h of one going to be equal to? It's going to be one-fourth times two to the first power. So it's going to be one-fourth times two. What is h of two going to be equal to? Well, it's going to be one-fourth times two squared, so it's going to be times two times two. Or, we could just view this as this is going to be two times h of one. And actually I should have done this when I wrote this one out, but this we can write as two times h of zero. So notice, if we were to take the ratio between h of two and h of one, it would be two. If we were to take the ratio between h of one and h of zero, it would be two. That is the common ratio between successive whole number inputs into our function. So, h of I could say h of n plus one over h of n is going to be equal to is going to be equal to actually I can work it out mathematically. One-fourth times two to the n plus one over one-fourth times two to the n. That cancels. Two to the n plus one, divided by two to the n is just going to be equal to two. That is your common ratio. So for the function h. For the function f, our common ratio is three. If we were to go the other way around, if someone said, hey, I have some function whose initial value, so let's say, I have some function, I'll do this in a new color, I have some function, g, and we know that its initial initial value is five. And someone were to say its common ratio its common ratio is six, what would this exponential function look like? And they're telling you this is an exponential function. Well, g of let's say x is the input, is going to be equal to our initial value, which is five. That's not a negative sign there, Our initial value is five. I'll write equals to make that clear. And then times our common ratio to the x power. So once again, initial value, right over there, that's the five. And then our common ratio is the six, right over there. So hopefully that gets you a little bit familiar with some of the parts of an exponential function, why they are called what they are called.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
eval-irInformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6326 |
| cosine_accuracy@3 | 0.7914 |
| cosine_accuracy@5 | 0.8481 |
| cosine_accuracy@10 | 0.8968 |
| cosine_precision@10 | 0.2383 |
| cosine_precision@50 | 0.0709 |
| cosine_precision@100 | 0.0392 |
| cosine_recall@10 | 0.7041 |
| cosine_recall@50 | 0.8725 |
| cosine_recall@100 | 0.917 |
| cosine_ndcg@10 | 0.6529 |
| cosine_mrr@10 | 0.7234 |
| cosine_map@100 | 0.5971 |
topic and content| topic | content | |
|---|---|---|
| type | string | string |
| details |
|
|
| topic | content |
|---|---|
Triangles and polygons. Space, shape and measurement. Form 1. Malawi Mathematics Syllabus. Learning outcomes: students must be able to solve problems involving angles, triangles and polygons including: types of triangles, calculate the interior and exterior angles of a triangle, different types of polygons, interior angles and sides of a convex polygon, the size and exterior angle of any convex polygon. |
Regular and Irregular Polygons. . |
Triangles and polygons. Space, shape and measurement. Form 1. Malawi Mathematics Syllabus. Learning outcomes: students must be able to solve problems involving angles, triangles and polygons including: types of triangles, calculate the interior and exterior angles of a triangle, different types of polygons, interior angles and sides of a convex polygon, the size and exterior angle of any convex polygon. |
Classifying triangles based on its angles. A triangle is a closed figure consisting of three-line segments which are joined end to end. The joined line segments of a triangle form three angles. You can classify triangles according to sides and angles.. Classifying triangles based on its angles |
Triangles and polygons. Space, shape and measurement. Form 1. Malawi Mathematics Syllabus. Learning outcomes: students must be able to solve problems involving angles, triangles and polygons including: types of triangles, calculate the interior and exterior angles of a triangle, different types of polygons, interior angles and sides of a convex polygon, the size and exterior angle of any convex polygon. |
Classifying triangles. Learn to categorize triangles as scalene, isosceles, equilateral, acute, |
MultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
eval_strategy: stepsper_device_train_batch_size: 128per_device_eval_batch_size: 128learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.05fp16: Trueload_best_model_at_end: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 128per_device_eval_batch_size: 128per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.05warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters: auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | eval-ir_cosine_ndcg@10 |
|---|---|---|---|
| 0.0007 | 1 | 0.1782 | - |
| 0.1999 | 297 | 0.1245 | 0.6279 |
| 0.3997 | 594 | 0.1224 | 0.6423 |
| 0.5996 | 891 | 0.1168 | 0.6493 |
| 0.7995 | 1188 | 0.1179 | 0.6541 |
| 0.9993 | 1485 | 0.1227 | 0.6529 |
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}