Download utils.py from cta2106/fgmonitor-semantic: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/cta2106/fgmonitor-semantic/resolve/main/utils.py
- Command line
-
hf download hf://cta2106/fgmonitor-semantic/utils.py
-
curl -L -o utils.py https://huggingface.co/cta2106/fgmonitor-semantic/resolve/main/utils.py
592 Bytes
| from typing import List, Dict | |
| from appsearch import AppSearchClient | |
| def get_us_speeches() -> List[Dict]: | |
| appsearch = AppSearchClient() | |
| us_speeches = appsearch.list_existing_docs("us-speeches") | |
| for items in us_speeches: | |
| if "_meta" in items: | |
| del items["_meta"] | |
| us_speeches_dict = [ | |
| { | |
| 'content': speech["text"], | |
| 'meta': {'filename': speech["filename"], 'speaker': speech["speaker"], 'date': speech["date"], | |
| 'url': speech["url"]} | |
| } for speech in us_speeches | |
| ] | |
| return us_speeches_dict | |