Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

getting multiple marks from the same question #17

Open
kiran-taylor opened this issue Dec 24, 2020 · 4 comments
Open

getting multiple marks from the same question #17

kiran-taylor opened this issue Dec 24, 2020 · 4 comments

Comments

@kiran-taylor
Copy link

kiran-taylor commented Dec 24, 2020

hi @rbaron. In this image "answered-sheet-photo-result.png", Question no-6 two options are marked Option-B and Option-D because it is marked with two options program bypasses it. is it possible to get multiple marks from the same question?

@kiran-taylor kiran-taylor changed the title getting multiple marks from the image getting multiple marks from the same question Dec 24, 2020
@rbaron
Copy link
Owner

rbaron commented Dec 24, 2020

Hi @kiran-taylor,

To get multiple marked alternatives for a single question, you can tweak the get_marked_alternative function. Currently it identifies the marked alternative by comparing it with the other ones:

# Simple heuristic
if sorted_means[0]/sorted_means[1] > .7:
    return None

This doesn't work if you want to consider multiple marked alternatives. The first thing I would try is using an absolute threshold instead of comparing the it with other alternatives. In this approach, you would consider every entry in this means list individually, and consider it marked if its value is below a threshold. Finding a suitable threshold will likely require some trial and error.

@kiran-taylor
Copy link
Author

yes, I tried increasing the value,

# Simple heuristic
if sorted_means[0]/sorted_means[1] > .9:
    return None 

if the single question has multiple marks it compares with alternatives and chooses a higher threshold value leaving lower.

@rbaron
Copy link
Owner

rbaron commented Dec 24, 2020

I think you would need to modify get_marked_alternative a little more. For instance, you would need to return multiple values from it, instead of just a single marked alternative. Additionally, comparing the "darkest" one with the second darkest one is not useful anymore, since both now could be legitimately marked.

The approach I suggested is something like this:

def get_marked_alternative(alternative_patches):
    means = list(map(np.mean, alternative_patches))

    # Here, we return all alternatives that we consider marked.
    return [
        alternative_index
        for alternative_index, mean in enumerate(means)
        if mean < THRESHOLD
    ]

You would need to experiment with a few values for THRESHOLD in order to figure out a good one that separates marked and unmarked alternatives well.

@kiran-taylor
Copy link
Author

thanks, will try it out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants