Hello I am trying to calculate cosine similarity between sentences with the given array that consist 5 words.So ı have an asp.net project where I wrote the code to calculate the top 5 words(by frequency) out of a text(around 50-60 sentences) and I have these words in array K.Until here everything is ok.I would like to get each sentences from text(which is an input in my problem and there is a text area inapp where user an paste any text or article) and established the vectors.For example; Lets assume that array
K={technology, product,player}
and the given text is this;
Apple Inc. is an American multinational technology company headquartered in Cupertino, California, that designs, develops, and sells consumer electronics, computer software, and online services. Its hardware products include the iPhone smartphone, the iPad tablet computer, the Mac personal computer, the iPod portable media player, and the Apple Watch smartwatch. Apple's consumer software includes the OS X and iOS operating systems, the iTunes media player, the Safari web browser, and the iLife and iWork creativity and productivity suites. Its online services include the iTunes Store, the iOS App Store and Mac App Store, and iCloud.
so four vectors for four sentences should be like this
s1={1,0,0} s2={0,1,1} s3={0,0,1} s4={0,0,0}
How can i establish these vector on asp.net?