microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
python/ta/demo.py
20lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | import asyncio |
| 5 | import os |
| 6 | |
| 7 | import dotenv |
| 8 | |
| 9 | from typeagent.knowpro import convknowledge |
| 10 | |
| 11 | |
| 12 | async def main(): |
| 13 | dotenv.load_dotenv(os.path.expanduser("~/TypeAgent/ts/.env")) # TODO: Only works in dev tree |
| 14 | # for k, v in os.environ.items(): |
| 15 | # print(f"{k}={v!r}") |
| 16 | ke = convknowledge.KnowledgeExtractor() |
| 17 | print(await ke.extract("There is a book about hobbits called the Lord of the Rings.")) |
| 18 | |
| 19 | |
| 20 | asyncio.run(main()) |
| 21 | |