Skip to main content
Code Review

Return to Question

move formula above code
Source Link

I wrote a script to calculate document distance code. It seems working but I couldntcouldn't be sure. (I tried for the small strings and it seems working) Also I am not sure that its fast enough for large texts.

Here is the Document Distance formula :

document distance forumla

The frequency is the number of occurrences for each object. Such as for "D1: be or not to be" the frequency will be freq$$(D_1) = {be=2, not=1, or=1, to=2}$$ and $$||D_1|| = \sqrt{2^2 + 1^2 + 1^2 + 2^2}$$

I did not use the acosacos function since I dontdon't think I need it.

Edit: People asked what is the document distance I am sharing a link

https://www.andrew.cmu.edu/course/15-121/labs/HW-4%20Document%20Distance/lab.html

enter image description here

The frequency is the number of occurrences for each object. Such as for "D1: be or not to be" the frequency will be freq$$(D_1) = {be=2, not=1, or=1, to=2}$$ and $$||D_1|| = \sqrt{2^2 + 1^2 + 1^2 + 2^2}$$

I wrote a document distance code. It seems working but I couldnt be sure. (I tried for the small strings and it seems working) Also I am not sure that its fast enough for large texts.

I did not use the acos since I dont think I need it.

Edit: People asked what is the document distance I am sharing a link

https://www.andrew.cmu.edu/course/15-121/labs/HW-4%20Document%20Distance/lab.html

enter image description here

The frequency is the number of occurrences for each object. Such as for "D1: be or not to be" the frequency will be freq$$(D_1) = {be=2, not=1, or=1, to=2}$$ and $$||D_1|| = \sqrt{2^2 + 1^2 + 1^2 + 2^2}$$

I wrote a script to calculate document distance. It seems working but I couldn't be sure. (I tried for the small strings and it seems working) Also I am not sure that its fast enough for large texts.

Here is the Document Distance formula :

document distance forumla

The frequency is the number of occurrences for each object. Such as for "D1: be or not to be" the frequency will be freq$$(D_1) = {be=2, not=1, or=1, to=2}$$ and $$||D_1|| = \sqrt{2^2 + 1^2 + 1^2 + 2^2}$$

I did not use the acos function since I don't think I need it.

Post Reopened by camarman, Graipher, ferada, dfhwze, Peilonrayz
added 299 characters in body
Source Link
camarman
  • 519
  • 2
  • 11

enter image description here

The frequency is the number of occurrences for each object. Such as for "D1: be or not to be" the frequency will be freq$$(D_1) = {be=2, not=1, or=1, to=2}$$ and $$||D_1|| = \sqrt{2^2 + 1^2 + 1^2 + 2^2}$$

enter image description here

The frequency is the number of occurrences for each object. Such as for "D1: be or not to be" the frequency will be freq$$(D_1) = {be=2, not=1, or=1, to=2}$$ and $$||D_1|| = \sqrt{2^2 + 1^2 + 1^2 + 2^2}$$

added 162 characters in body
Source Link
camarman
  • 519
  • 2
  • 11

Edit: People asked what is the document distance I am sharing a link

https://www.andrew.cmu.edu/course/15-121/labs/HW-4%20Document%20Distance/lab.html

Edit: People asked what is the document distance I am sharing a link

https://www.andrew.cmu.edu/course/15-121/labs/HW-4%20Document%20Distance/lab.html

Post Closed as "Needs details or clarity" by IEatBagels, t3chb0t, Dan Oberlam, pacmaninbw , Sᴀᴍ Onᴇᴌᴀ
edited tags; edited title
Link
200_success
  • 145.5k
  • 22
  • 190
  • 478
Loading
Source Link
camarman
  • 519
  • 2
  • 11
Loading
lang-py

AltStyle によって変換されたページ (->オリジナル) /