[ Prev ]
2022-02-25

-- Feb 22 In-Class Exercise Thread
d1="All the king's horses and all the king's men"
d2 = "Which is correct: all of the people, all the people, or all people?"

calculating rankProximity("all", "the", 2):

For d1:

    [u,v] = (0,1)
    d = 1
    score = 0

    As u < infty:
        as d == 0:
            score = score + 1/(v-u+1)
                = 0 + 1/(1-0+1)
                = 0.5
    now [u,v] = nextCover
              = (1,5)

    As u < infty and d == 0:
        score = 0.5 + 1/(5-1+1)
              = 0.7
    now [u,v] = nextCover
              = (5,6)

    As u < infty and d == 0:
        score = 0.7 + 1/(6-5+1)
              = 0.7
              = 1.2
    now [u,v] = nextCover
              = (3,5)

    As u < infty and d < docid(u):
        j = 1
        Result[1].docid = 0
        Result[1].score = 1.2

        d = 1
        score = 0

For d2:
    [u,v] = [3, 5]

    As u < infty and d == docid(u):
        score = 0 + 1/(5-3+1)
              = 0.33
    now [u,v] = nextCover
              = (5,7)

    As u < infty and d == docid(u):
        score = 0.33 + 1/(7-5+1)
              = 0.66
    now [u,v] = nextCover
              = (7,8)

    As u < infty and d == docid(u):
        score = 0.66 + 1/(8-7+1)
              = 1.16
    now [u,v] = nextCover
              = (8,11)

    As u < infty and d == docid(u):
        score = 1.16 + 1/(11-8+1)
              = 1.41
    
    j = 2
    Result[2].docid = 1
    Result[2].score = 1.41

Now, sorting result on scores:

Ranking     Score:
d2          1.41
d1          1.2

((resource:rank_proximity.txt|Resource Description for rank_proximity.txt))
2022-02-26

-- Feb 22 In-Class Exercise Thread
Resource Description for IMG_5922.JPG Resource Description for IMG_5923.JPG
((resource:IMG_5922.JPG|Resource Description for IMG_5922.JPG)) ((resource:IMG_5923.JPG|Resource Description for IMG_5923.JPG))
2022-02-28

-- Feb 22 In-Class Exercise Thread
d1 = “All the king's horses and all the king's men"
d2 = "Which is correct: all of the people, all the people, or all people?"
rankProximity(“all”, “the”, 2)
For document 1:
j = 0, d = 1, score = 0
[u,v] = [0,1], [1,5], [5,6]
score1 = 0 + 0.5 = 0.5
score2 = 0.5 + 0.2 = 0.7
score3 = 0.7 + 0.5 = 1.2
result[1].docid = 1
result[1].score = 1.2
For document 2:
[u,v] = [3,5], [5,7], [7,8], [8,11]
j = 1, d = 2, score = 0
score1 = 0 + 0.33 = 0.33
score2 = 0.33 + 0.33 = 0.66
score3 = 0.66 + 0.5 = 1.166
score4 = 1.166 + 0.25 = 1.416
result[2].docid = 2
result[2].score = 1.416
result = [{score = 1.416, doc_id=2},{score = 1.2, doc_id= 1}]
d1 = “All the king's horses and all the king's men" d2 = "Which is correct: all of the people, all the people, or all people?" rankProximity(“all”, “the”, 2) For document 1: j = 0, d = 1, score = 0 [u,v] = [0,1], [1,5], [5,6] score1 = 0 + 0.5 = 0.5 score2 = 0.5 + 0.2 = 0.7 score3 = 0.7 + 0.5 = 1.2 result[1].docid = 1 result[1].score = 1.2 For document 2: [u,v] = [3,5], [5,7], [7,8], [8,11] j = 1, d = 2, score = 0 score1 = 0 + 0.33 = 0.33 score2 = 0.33 + 0.33 = 0.66 score3 = 0.66 + 0.5 = 1.166 score4 = 1.166 + 0.25 = 1.416 result[2].docid = 2 result[2].score = 1.416 result = [{score = 1.416, doc_id=2},{score = 1.2, doc_id= 1}]

-- Feb 22 In-Class Exercise Thread
Resource Description for Screen Shot 2022-02-28 at 9.46.01 AM.png
((resource:Screen Shot 2022-02-28 at 9.46.01 AM.png|Resource Description for Screen Shot 2022-02-28 at 9.46.01 AM.png))

-- Feb 22 In-Class Exercise Thread
Resource Description for Screenshot 2022-02-28 at 11.14.55 AM.png
((resource:Screenshot 2022-02-28 at 11.14.55 AM.png|Resource Description for Screenshot 2022-02-28 at 11.14.55 AM.png))

-- Feb 22 In-Class Exercise Thread
Resource Description for Screen Shot 2022-02-28 at 11.15.50 AM.png
((resource:Screen Shot 2022-02-28 at 11.15.50 AM.png|Resource Description for Screen Shot 2022-02-28 at 11.15.50 AM.png))

-- Feb 22 In-Class Exercise Thread
d1 = "All the king's horses and all the king's men" d2 = "Which is correct: all of the people, all the people, or all people?"
calculating rankProximity("all", "the", 2) we get,
In the case of d1:
[u, v] = [0, 1], [1, 5], [5, 6] score = 0, d = 1, j = 0 score1 = 0 + (1/2) = 0.5 score2 = 0.5 + (1/5) = 0.7 score3 = 0.7 + 0.5 = 1.2 result[1] = {docid = 1, score = 1.2}
In the case of d2:
[u,v] = [3,5], [5,7], [7,8], [8,11] score = 0, d = 2, j = 1 score1 = 0 + 0.33 = 0.33 score2 = 0.33 + 0.33 = 0.66 score3 = 0.66 + 0.5 = 1.166 score4 = 1.166 + 0.25 = 1.416 result[2] = {docid = 2, score = 1.416}
After sorting based on score, result = [{docid = 2, score = 1.416}, {docid = 1, score = 1.2}]
d1 = "All the king's horses and all the king's men" d2 = "Which is correct: all of the people, all the people, or all people?" calculating rankProximity("all", "the", 2) we get, In the case of d1: [u, v] = [0, 1], [1, 5], [5, 6] score = 0, d = 1, j = 0 score1 = 0 + (1/2) = 0.5 score2 = 0.5 + (1/5) = 0.7 score3 = 0.7 + 0.5 = 1.2 result[1] = {docid = 1, score = 1.2} In the case of d2: [u,v] = [3,5], [5,7], [7,8], [8,11] score = 0, d = 2, j = 1 score1 = 0 + 0.33 = 0.33 score2 = 0.33 + 0.33 = 0.66 score3 = 0.66 + 0.5 = 1.166 score4 = 1.166 + 0.25 = 1.416 result[2] = {docid = 2, score = 1.416} After sorting based on score, result = [{docid = 2, score = 1.416}, {docid = 1, score = 1.2}]
X