microsoft/TypeAgent

Public

mirrored fromhttps://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
f8bb760fa7ccfd347d30af87bba3a137c75ee74e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

python/ta/demo.py

20lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4import asyncio
5import os
6
7import dotenv
8
9from typeagent.knowpro import convknowledge
10
11
12async 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
20asyncio.run(main())
21