-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enhance output of audformat.Database.description #59
Labels
enhancement
New feature or request
Comments
It's not only description: >>> db = audb.load('iemocap', versdion='2.2.0', only_metadata=True)
>>> db.schemes["dialog.act"]
description: Dialogue act annotations.Released by https://github.com/sahatulika15/EMOTyDA.Please
cite the respective paper whenever using it.
dtype: str
labels: {g: greeting, q: question, ans: answer, o: statement-opinion, s: statement-non-opinion,
ap: apology, ag: agreement, dag: disagreement, a: acknowledgement, b: backchanneling,
c: command, oth: other}
bibtex: "\n @inproceedings{saha-etal-2020-towards,\n \
\ title = \"Towards Emotion-aided Multi-modal Dialogue Act Classification\"\
,\n author = \"Saha, Tulika and\n Patra,\
\ Aditya and\n Saha, Sriparna and\n Bhattacharyya,\
\ Pushpak\",\n booktitle = \"Proceedings of the 58th Annual Meeting\
\ of the Association for Computational Linguistics\",\n month\
\ = jul,\n year = \"2020\",\n address = \"\
Online\",\n publisher = \"Association for Computational Linguistics\"\
,\n url = \"https://www.aclweb.org/anthology/2020.acl-main.402\"\
,\n doi = \"10.18653/v1/2020.acl-main.402\",\n \
\ pages = \"4361--4372\",\n }\n " |
import audformat
bibtex = '@inproceedings{saha-etal-2020-towards,\n\
title = "Towards Emotion-aided Multi-modal Dialogue Act Classification"\n\
author = "Saha, Tulika and\n\
Patra, Aditya and\n\
Saha, Sriparna and\n\
Bhattacharyya, Pushpak"\n\
booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",\n\
month = jul,\n\
year = "2020",\n\
address = "Online",\n\
publisher = "Association for Computational Linguistics"\n\
url = "https://www.aclweb.org/anthology/2020.acl-main.402"\n\
doi = "10.18653/v1/2020.acl-main.402",\n\
pages = "4361--4372"'
db = audformat.testing.create_db(minimal=True)
db.schemes['scheme'] = audformat.Scheme(meta={'bibtex': bibtex})
print(db.schemes['scheme'])
can be prettified to: def str_presenter(dumper, data):
if len(data.splitlines()) > 1: # check for multiline string
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|')
return dumper.represent_scalar('tag:yaml.org,2002:str', data)
yaml.add_representer(str, str_presenter)
print(db.schemes['scheme'])
For some reason it did not work with the above example, though. But the formatting of the string looks also a bit odd. |
This might indeed be a solution. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment we get the following:
which is not very nice to read.
It get's even worse if you have some real formatting in the description string.
For example, for
audioset
the description contains:which would be nice if we could preserve it when printing to screen.
The text was updated successfully, but these errors were encountered: