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

Proposal: adding metadata to dialog files #56

Open
JarbasAl opened this issue Mar 19, 2023 · 8 comments
Open

Proposal: adding metadata to dialog files #56

JarbasAl opened this issue Mar 19, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@JarbasAl
Copy link
Member

JarbasAl commented Mar 19, 2023

Problems being solved

  • 1 - in some languages TTS utterances may depend on the gender of the person listening
  • 2 - in some languages TTS utterances may depend on the gender of the speaker
    • eg. in portuguese you there is no gender neutral way to say "thank you", you say "obrigado"/"obrigada"
    • this would be a setting of the voice assistant
  • 3 - personality settings
    • "increase sarcasm by 20%"

Dialog Json

New file format, .jsonl, where each line in the file contains a json of the format

{"utterance": "XXX", "attitude": "sarcastic", "assistant_gender": "male", "listener_gender": "male", "weight": 0.3}

jsonl format info: https://jsonlines.org

Personality Settings

in mycroft.conf users can tweak personality

weights reflect how likely a dialog is to be selected

"persona": {
    "gender": "male",
    "attitudes": {
        "normal": 10,
        "flippant": 8.0,
        "funny": 8.0,
        "irritable": 0
      }
}

How it works

  • 1 - load .jsonl file if it exists, else old .dialog file
  • 2 - filter samples per assistant gender
  • 3 - select an attitude based on weights defined in mycroft.conf
  • 4 - filter samples per attitudes
  • 5 - select based on weights of .jsonl file

references

previous discussions

@JarbasAl JarbasAl added enhancement New feature or request question Further information is requested labels Mar 19, 2023
@builderjer
Copy link
Member

builderjer commented Mar 19, 2023

I like the idea, but with more and more metadata added, does it increase the overhead? or not enough to matter? I am not exactly clear how much processing power the metadata from here, and from utterances and ... actually take.

I know with c++ pointers it wouldn't be noticeable at all, but with python, I just don't know.

@ChanceNCounter
Copy link

ChanceNCounter commented Mar 19, 2023

We can revisit everything about this if we want, so leave nothing on the table. I am in favor of replacing certain components with compiled funbits, but that’s getting into a broader discussion that I was hoping would wait until the upstream/downstream situation is settled in writing.

Edit: the dialog renderer would be a good place for me to put my money where my mouth is in that regard

@NeonDaniel
Copy link
Member

I would propose refactoring this to keep it in sync with the dialog:

dialog.yaml

- name: hello
  dialog:
  - hi {{name}}
  - hello, {{name}}
  persona: {}
- name: goodbye
...

In the "old style", this would have been hello.dialog and goodbye.dialog. In either case, I prefer yaml files for user-specified resources like this to enforce readability for the next person and avoid troubleshooting punctuation

@JarbasAl
Copy link
Member Author

this is jsonl, each line is valid json, doesnt really work well with yaml IMHO...

https://jsonlines.org/

I also quite like that we get a direct translation into a python dict, im not a fan of yaml in general, dont want to rehash this talk but more on yaml vs json has been said in linked issue above

@ChanceNCounter
Copy link

For the record, all JSON is valid YAML. The reverse is not true. If we support YAML, anybody who prefers JSON can just keep using it.

@JarbasAl
Copy link
Member Author

updated initial comment to clarify what is being proposed is jsonL format, not json

@NeonDaniel
Copy link
Member

this is jsonl, each line is valid json, doesnt really work well with yaml IMHO...

https://jsonlines.org/

I also quite like that we get a direct translation into a python dict, im not a fan of yaml in general, dont want to rehash this talk but more on yaml vs json has been said in linked issue above

I had missed that, but still not sure I like json as a format for things one might edit/override in a terminal/text editor (as you said, we've been down that road before).

On the other hand, this is probably sufficiently complex enough that we could justify a utility to generate the output so a skill author doesn't miss any params and to guide them through providing enough alternative utterances for different personas

@ChanceNCounter
Copy link

I agree with Daniel above, on all counts. I also think a utility could work just as well for a YAML/JSON solution, however, which would be as thoroughly accessible as I can imagine.

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

No branches or pull requests

4 participants