Skip to content

Instantly share code, notes, and snippets.

@fititnt
Last active March 29, 2021 10:23
Show Gist options
  • Save fititnt/3dd12c61170d290fe94cafb1f672a0b5 to your computer and use it in GitHub Desktop.
Save fititnt/3dd12c61170d290fe94cafb1f672a0b5 to your computer and use it in GitHub Desktop.
Jupyter notebooks testes from HXL-Data-Science-file-formats; see https://github.com/EticaAI/HXL-Data-Science-file-formats

Jupyter Notebook with examples of direct access to HDP files processing

See EticaAI/HXL-Data-Science-file-formats in special

Note: after some time these linkes may be broken. So check @EticaAI or @fititnt repositories.

To run these Jupyter notebooks

TODO: explain more

Notes

  • Files starting with zzz_ are mostly for testing and/or, even if eventually do not get obsolete, are not meant to be good reference of usage.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python38564bit579b9a52561c42379acf4b07992b6d5f",
"display_name": "Python 3.8.5 64-bit",
"language": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"# Build-in HXLm data sets"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"HXLm version: 0.8.4\nENV LANGUAGE (now): gn_BR:gn:pt_BR:pt:se_SE:se:sv:en\nUser know languages that we also have VKG: ['POR', 'ENG']\n"
]
}
],
"source": [
"import hxlm.core as HXLm\n",
"import os\n",
"\n",
"print('HXLm version: ', HXLm.__version__)\n",
"# print('HXLm VKS+LIDs: ', HXLm.L10N.get_localization_lids())\n",
"\n",
"os.environ['LANGUAGE'] = 'gn_BR:gn:pt_BR:pt:se_SE:se:sv:en'\n",
"print('ENV LANGUAGE (now): ', os.getenv('LANGUAGE'))\n",
"print('User know languages that we also have VKG: ', HXLm.L10N.get_language_user_know())"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"hdatum_UDHD = HXLm.HDP.load(HXLm.HDATUM_HXL)\n",
"hdatum_HXL = HXLm.HDP.load(HXLm.HDATUM_HXL)"
]
},
{
"source": [
"from IPython.display import display, Markdown\n",
"\n",
"hdatum_HXLmardown = \"# Example of markdown output \\n```json \\n\" + str(HXLm.HDP.to_yaml(hdatum_HXL)) + \"\\n```\"\n",
"\n",
"\n",
"display(Markdown(hdatum_HXLmardown))\n"
],
"cell_type": "code",
"metadata": {},
"execution_count": 3,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<IPython.core.display.Markdown object>",
"text/markdown": "# Example of markdown output \n```json \nb'- ([English language]):\\n - hxl.eng.hdp.yml\\n computer-file:\\n - description:\\n ENG: HXL core schema\\n id: hxl-core-schema\\n source:\\n - iri: https://docs.google.com/spreadsheets/d/1En9FlmM8PrbTWgl3UHPF_MXnJ6ziVZFhBbojSJzBdLI/edit#gid=319251406\\n tag:\\n - google-sheets\\n data-set:\\n - description:\\n ENG: HXL/CSV version of the core hashtags\\n id: hxl-standard-core-hashtag\\n source:\\n - iri: https://docs.google.com/spreadsheets/d/1En9FlmM8PrbTWgl3UHPF_MXnJ6ziVZFhBbojSJzBdLI/pub?gid=319251406&single=true&output=csv\\n - description:\\n ENG: HXL/CSV version of the core attributes\\n id: hxl-standard-core-attribute\\n source:\\n - iri: https://docs.google.com/spreadsheets/d/1En9FlmM8PrbTWgl3UHPF_MXnJ6ziVZFhBbojSJzBdLI/pub?gid=1810309357&single=true&output=csv\\n silo:\\n country:\\n - XZ\\n description:\\n ENG: The Humanitarian Exchange Language Standard datasets\\n group:\\n - hxl-standard\\n tag:\\n - humanitarian\\n - hxl\\n - hxl-standard\\n'\n```"
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment