Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classifier: Enable subject selection by subject ID in the subjects store #1876

Closed
eatyourgreens opened this issue Nov 3, 2020 · 4 comments · Fixed by #2148
Closed

Classifier: Enable subject selection by subject ID in the subjects store #1876

eatyourgreens opened this issue Nov 3, 2020 · 4 comments · Fixed by #2148
Labels
enhancement New feature or request

Comments

@eatyourgreens
Copy link
Contributor

Package
lib-classifier

Is your feature request related to a problem? Please describe.
When a subject ID is passed into the classifier as a prop, that subject should be loaded into the store and shown as the first classification subject.

When a workflow has prioritised (sequential) selection enabled, subsequent subjects in the queue should follow on from the selected subject eg. if I select page 15 from a volume, I'd expect pages 16, 17 etc. to follow in the queue.

Describe the solution you'd like
I'll open an issue on Panoptes for the server-side component for this, but we could pass the subject ID when making a request to /api/subjects/queued.

Alternatively, we could wait until the specified subject has been classified before requesting the rest of the queue. I think that should work, since prioritised selection ought to send back subjects based on the last subject that you classified.

@eatyourgreens eatyourgreens added the enhancement New feature or request label Nov 3, 2020
@camallen
Copy link
Contributor

camallen commented Nov 3, 2020

here is a linked issue that describes a part of your use case, the subject context before / after. zooniverse/panoptes#2043 and this was a start on the feature, zooniverse/panoptes#3156

I could see that end point supporting query params, say ?start_index=0 to change the selection ordering from a middle point (default), e.g.
/subjects/:id/sequential?start=0&limit=4 -> [ SUBJECT_ID, A1, A2, A3, A4 ]

the above could support the surrounding subjects, 'context', feature as well as this use case of show me here onwards. thoughts?

@eatyourgreens
Copy link
Contributor Author

eatyourgreens commented Nov 3, 2020

I think that would work. The subjects endpoint would have to be abstracted out of the classifier store in subjects.populateQueue(), maybe by having workflows implementing different queue population strategies.

try {
const { authClient } = getRoot(self)
const authorization = yield getBearerToken(authClient)
const response = yield client.get(`/subjects/queued`, params, { authorization })
if (response.body.subjects && response.body.subjects.length > 0) {
self.append(response.body.subjects)
}
self.loadingState = asyncStates.success
} catch (error) {
console.error(error)
self.loadingState = asyncStates.error
}

EDIT: Maybe

const strategy = workflow.subjectStrategy
const subjects = strategy.getSubjects(params)

@eatyourgreens
Copy link
Contributor Author

We may also have the subjects cached already, since the project home page is going to show volunteers a paged, ordered list of subjects, from a single subject set. They then pick a single subject to start classifying from but we could initialise the classifier with 10 subjects from that list.

@eatyourgreens
Copy link
Contributor Author

Another option would be to request subjects from /queued, then filter out everything prior to the selected subject. We'd have to make sure not to start too close to the end of the queue. Refreshing the queue at this point would return exactly the same list of subjects again, possibly putting the queue into a loop of refreshing, filtering and refreshing again. Maybe request N + 10 subjects from /queued, where N is the number of subjects available to be picked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants