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

Batch edit #1268

Open
Woseseltops opened this issue Jun 20, 2024 · 41 comments
Open

Batch edit #1268

Woseseltops opened this issue Jun 20, 2024 · 41 comments
Assignees
Labels
enhancement live collaboration For live meetings between users and developers pull request

Comments

@Woseseltops
Copy link
Collaborator

  • Somewhere in the search results there is a button 'batch edit'
  • This button brings you to the BatchEditListView, where you see each search result as a row, and as columns:
    • The small video
    • The gloss annotation ID
    • Several editable gloss fields, which @uklomp will provide below
  • Important: the BatchEditListView has only one Apply button (unlike the detail view, where you have to click OK for every change you make)
@Woseseltops Woseseltops added enhancement live collaboration For live meetings between users and developers labels Jun 20, 2024
@susanodd
Copy link
Collaborator

I'm working on the BatchEditForm now.
For Senses, only existing senses can be edited (translations filled in, as discussed).

(At the moment, new senses cannot be created, and senses cannot be reordered. Gloss Edit will need to be used for that. Otherwise too much interface code is needed.)

@susanodd
Copy link
Collaborator

susanodd commented Jun 22, 2024

@uklomp do all glosses have senses?

If the gloss does not have senses, do you want an empty field to appear?
Or only to appear if a language has not been filled in? (Like a touch up edit.)

To avoid yet another method to create senses if possible?

At the moment, there is Gloss Edit, Keywords Mapping Edit (this is also batch edit but just for senses), and API create gloss, and API update gloss.

The Analysis -> Keywords Mapping was meant to facilitate the change from the Keywords system to the Senses system for already existing glosses, since there were only keywords to begin with. These can then be split up into senses.

@susanodd
Copy link
Collaborator

susanodd commented Jun 22, 2024

I have some of the fields done already. The toggles are implemented and work. The language fields can be edited, but a Save button is needed for these. (Hence my question above. As you can see there are no fields for the senses for this specific gloss -- a copy from NGT to tstMH, the Copy button only copies phonology.)

batch-edit-wegdoen-1

@susanodd
Copy link
Collaborator

susanodd commented Jun 22, 2024

The plan is to show videos for similar glosses below when say Handedness, Strong Hand and Weak Hand have been filled in.

(Enough fields need to be filled in or there can be thousands, if you only have Handedness filled in.)

Sufficient fields need to be available in the Toggles area in order to narrow down the focus.

Perhaps a button when you think the gloss phonology is "done" to generate the similar gloss videos?
(There needs to be phonology for the other glosses obviously.)
(A new search would be needed if the similar glosses are not in the list of batch edit glosses, so you could work on them all if needed to disambiguate if more phonology is needed.)
The facility to generate a search based on the single gloss phonology is available via the Query button in Gloss Detail View.

@susanodd
Copy link
Collaborator

susanodd commented Jun 22, 2024

Here is what happens with displaying the senses this way. This is one of the test glosses that we used when Senses were being developed. The keywords are split into different senses. (Although as non-signers, we have no idea if this is nonsense.) This looks a bit much. Although this is what it looks like.
We implemented the functionality for already existing glosses to split the keywords in different senses.

batch-edit-brus-A-senses-display

@susanodd
Copy link
Collaborator

susanodd commented Jun 22, 2024

I can make it so the language fields also collapse to hide them. Suggestions are welcome!
Think about what you need to be able to do in batch edit.

susanodd added a commit that referenced this issue Jun 22, 2024
@susanodd
Copy link
Collaborator

susanodd commented Jun 22, 2024

Here you can see one with the EN senses with empty fields.
Only two phonology toggles are implemented so far, so the rest don't show yet for the glosses.

batch-edit-ngt-kweek

@susanodd
Copy link
Collaborator

More toggles added, showing highlighted sense translation field:

batch-edit-ngt-kweek-2

susanodd added a commit that referenced this issue Jun 24, 2024
Moved video to same table cell table as gloss affiliation and creator
@uklomp
Copy link
Collaborator

uklomp commented Jun 24, 2024

@uklomp do all glosses have senses?

If the gloss does not have senses, do you want an empty field to appear? Or only to appear if a language has not been filled in? (Like a touch up edit.)

To avoid yet another method to create senses if possible?

At the moment, there is Gloss Edit, Keywords Mapping Edit (this is also batch edit but just for senses), and API create gloss, and API update gloss.

The Analysis -> Keywords Mapping was meant to facilitate the change from the Keywords system to the Senses system for already existing glosses, since there were only keywords to begin with. These can then be split up into senses.

Not all glosses have senses, I'd like to be able to add them then yes, so a field would be good.
Would it be possible to have all English stuff in a column next to the Dutch stuff? At least for the senses, but preferably also for the glosses and lemmas. So not all underneath each other, but English next to Dutch.

@susanodd
Copy link
Collaborator

susanodd commented Jun 24, 2024

Not all glosses have senses, I'd like to be able to add them then yes, so a field would be good. Would it be possible to have all English stuff in a column next to the Dutch stuff? At least for the senses, but preferably also for the glosses and lemmas. So not all underneath each other, but English next to Dutch.

I'll experiment with that next. I have the phonology fields working as shown above. Just need to keep adding more.

The query results has been done so it starts with the query results in the list.

I'm working on the language fields now.
I added a panel "language fields" with a button "save language fields" button in the toggles area.

batch-edit-languages-fields-panel-save-button

I'll modify the display to show the languages in columns.

Do you want more things in the Language Fields panel?
(The Save button is there so it's more like the phonology toggle buttons.)

A create button for senses?
An "assign lemma" to replace the lemma with an existing lemma?
Another option is to put the "new contents" in the languages panel and on update shove it into the fields to the left.
Then the fields on the left could look prettier.

I'll do the columns next and post a screenshot.

@susanodd
Copy link
Collaborator

Here's with columns (the display scrolls to the right):

batch-edit-kweek-language-columns

batch-edit-kweek-language-columns-scroll-right

@uklomp
Copy link
Collaborator

uklomp commented Jun 24, 2024

I remember that we talked about making phonology work this way, but I didn't remember putting them in this BatchEdit as well. I'm not sure yet if it's a benefit, but it's also not a disadvantage I suppose.

Senses in two columns: looks way better, thanks.

What do you mean with language fields, I have no idea what they are?

@susanodd
Copy link
Collaborator

susanodd commented Jun 24, 2024

I remember that we talked about making phonology work this way, but I didn't remember putting them in this BatchEdit as well. I'm not sure yet if it's a benefit, but it's also not a disadvantage I suppose.

Senses in two columns: looks way better, thanks.

What do you mean with language fields, I have no idea what they are?

The language fields (what I call them, code wise) are dependent on the translation languages of the dataset.
Here the user enters text
But they need to be generated dynamically for the input form, because of the languages/dataset
(the code is more complicated because it includes a language code, e.g., lemma_NNNN_nl
(for gloss NNNN lemma in Dutch) Those are the internal labels attached to the text fields of the input form.

Because batch edit is a giant input area, the form fields have the gloss id attached, the buttons have the id attached,...

The phonology is super easy to update this way, no pulldowns.

What about calling them "Text Translation Fields" ?
(There needs to be some way to identify them on the page.)

It would be possible to just hit Enter after updating some text. But that could go wrong if the user forgets to type enter. The fields will looked changed on the screen after editing the text. But there needs to be a signal to the computer that it is ready to save. (Hence the OK buttons all over the place in Gloss Edit.)

The text fields are handled differently because for each text field, there are some other objects attached.
In contrast, the phonology fields are fields of the gloss itself.
But the translated text fields are stored in other tables. So different implementation code is needed.

@susanodd
Copy link
Collaborator

susanodd commented Jun 24, 2024

I remember that we talked about making phonology work this way, but I didn't remember putting them in this BatchEdit as well. I'm not sure yet if it's a benefit, but it's also not a disadvantage I suppose.

We talked about having the similar glosses show up while you are entering the phonology.
This will work in this view when you are filling in phonology for a gloss that does not have phonology yet.

(For glosses that have the phonology filled in already, you can see homonyms and minimal pairs, or use the Query button to search on the glosses's phonology fields.)
(With the toggles, you are gradually filling in more phonology, so it's possible to show glosses that have the same as has been entered. But it ought to be more than handedness, because there are thousands of similar glosses if only handedness is filled in.)

This would be weird to do in Gloss Edit, since you are in Edit mode and all the cells are red, waiting for input.

With Batch Edit, you don't need to keep reloading the page nor go to a different list view.
You can just keep editing the glosses on the page, in-line.

susanodd added a commit that referenced this issue Jun 24, 2024
add to revision history. Give feedback when update not possible
@susanodd
Copy link
Collaborator

susanodd commented Jun 24, 2024

[NOTE TO SELF SKIP]

This is implemented now, except for the senses.

There needs to be some kind of indicator so the user will know when the text fields have been updated in the database.
In gloss detail edit, you see this because you are inside a form field with the OK button, then leave it and go to the next field.

With the batch edit form, you type in text and the fields appear changed in the display, but nothing is saved until you hit the save button for the gloss.
After clicking save, error message feedback appears under the save button.
But what to do if the save is okay?
And what to do if the user changes the text again?

We could use separate entry fields for the "new" text versus the "gloss" text. Then you would see the fields update.
(As is done for the toggles.)

Or I can make it show success feedback or a green checkmark.

Django can keep track of the gloss field values. But if you change this in the form, then you need to do something (user needs to click on something) in order for Django to fetch the gloss data for the field again. (When you update the text, you are changing what is on the screen.)
This works really well for the toggles, they are WYSIWYG. But for text, this is not apparent to the user.

I'll try adding a green checkmark after save. Or when the text matches the contents of the gloss. Or a different checkmark if the on-screen text has been changed. (But this cannot be know, because the real values are in the database.)

That's probably confusing.

This could be solved by putting the "entry text fields" in the panel to the right and not type directly into the fields. Then clicking on save, you would see the fields on the left updated.

@susanodd
Copy link
Collaborator

FEEDBACK SCREENSHOTS updating text fields / language fields

batch-edit-lemma-error

batch-edit-no-changes

batch-edit-annotation

batch-edit-saved-to-dataset

@susanodd
Copy link
Collaborator

[NOTE TO SELF] There might need to be a clear form button after an unsuccessful attempt to update the text fields.
(At the moment, the proposed changes still remain visible. Need to investigate.)

@susanodd
Copy link
Collaborator

susanodd commented Jun 25, 2024

@uklomp this is on signbank-test now. UNDER THE ANALYSIS MENU

@susanodd
Copy link
Collaborator

susanodd commented Jun 26, 2024

  • Somewhere in the search results there is a button 'batch edit'

  • This button brings you to the BatchEditListView, where you see each search result as a row, and as columns:

    • The small video
    • The gloss annotation ID
    • Several editable gloss fields, which @uklomp will provide below
  • Important: the BatchEditListView has only one Apply button (unlike the detail view, where you have to click OK for every change you make)

One comment here, there are no small videos. The creation of small videos has been broken for a long time. There is a bug in the CNGT scripts.
The videos are merely displayed smaller.
@Jetske determined that the bug relates to fps, that a different frame rates is used by some video software and the error occurs because when resized to a smaller video the length (in number of frames and frames per second) no longer matches that of the input video and can't be mp4.

@susanodd
Copy link
Collaborator

susanodd commented Jul 2, 2024

The hyperlink annotation shown under the video is updated to show an update to the dataset default annotation.

@susanodd
Copy link
Collaborator

susanodd commented Jul 4, 2024

Most recent code is on signbank-test.

Here, the panels are now collapsible and there are videos for the similar glosses. The values of the phonology fields are shown in the buttons now. You can turn the buttons on and off to refine the query.

kweek-collapsed-panels

kweek-similar-glosses-preview

susanodd pushed a commit that referenced this issue Jul 4, 2024
Show help message and link to Signs Search.
susanodd pushed a commit that referenced this issue Jul 4, 2024
Fixed typo and retrieval error in annotation constraint checking.
@susanodd
Copy link
Collaborator

susanodd commented Jul 4, 2024

Text Fields panel OPEN on viewing. (User can explicitly close them.)

susanodd pushed a commit that referenced this issue Jul 4, 2024
Toggle named entitiy and word class added to revision history
susanodd added a commit that referenced this issue Jul 5, 2024
@susanodd
Copy link
Collaborator

susanodd commented Jul 5, 2024

  • Somewhere in the search results there is a button 'batch edit'

  • This button brings you to the BatchEditListView, where you see each search result as a row, and as columns:

    • The small video
    • The gloss annotation ID
    • Several editable gloss fields, which @uklomp will provide below
  • Important: the BatchEditListView has only one Apply button (unlike the detail view, where you have to click OK for every change you make)

For each gloss, there will be a SAVE TEXT button.
For the purpose of "atomic transaction" and "checking constraints" this is necessary. Otherwise, work by other users of signbank during the time a user is "busy" changing text fields, may interfere and prevent work from being saved.

Updates to the "text fields" of EACH gloss involves updates to the following TABLES / related objects to the gloss:

  • Gloss
  • LemmaIdglossTranslation
  • AnnotationIdglossTranslation
  • Keyword
  • Translation
  • SenseTranslation
  • Sense
  • GlossSense
  • GlossRevision

Additionally, video files may be moved if lemma translations or gloss annotations of one gloss have been updated.

@Woseseltops
Copy link
Collaborator Author

Hey @uklomp (when you're back), Susan and I disagree about whether there should be 1 generic 'save/apply' button instead of a separate one for each gloss. I don't remember your viewpoint here? Susan does correctly note that if there's only one button, you might get a whole list of objections, similar to what you get when uploading a CSV.

@susanodd
Copy link
Collaborator

susanodd commented Jul 10, 2024

There are sufficient phonology fields now to show the similar glosses to KOE-A (example given at the live meeting)
(Observe that some "similar gloss fields" shown have been toggled off so to be ignored in the Query.)

similar-glosses-koe-a

@susanodd
Copy link
Collaborator

All but one phonology field added. Here's what the quick search on similar glosses looks like for KOE-A now.

similar-koe-a

@susanodd
Copy link
Collaborator

susanodd commented Jul 15, 2024

On initial view, all the phonology area are closed and only the text fields are visible.

batch-edit-initial

I designed it this way because this allows the users to conveniently check and correct the phonology here, if necessary, without needing to go to a different page.
This page does not need to be reloaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement live collaboration For live meetings between users and developers pull request
Projects
None yet
Development

No branches or pull requests

3 participants