This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#meta#> | |
- Date: 2023-05-16 | |
- Task: kg | |
<#system#> | |
You are an AI assistant who will help the user with all their information requests. | |
<#chat#> | |
<#user#> | |
Your task is to construct a comprehensive Temporal Knowledge Graph | |
1. Read and understand the Document: Familiarize yourself with the essential elements, including (but not limited to) ideas, events, people, organizations, impacts, and key points, along with any explicitly mentioned or inferred dates or chronology | |
- Pretend the date found in 'Date' is the current date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twython import Twython, TwythonRateLimitError, TwythonError | |
from glob import glob | |
from util import sleep_until | |
from csv import DictReader, DictWriter | |
import os | |
APP_KEY = '' | |
ACCESS_TOKEN = '' | |
tw = Twython(APP_KEY, access_token=ACCESS_TOKEN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.corpus import wordnet as wn | |
from nltk.corpus import wordnet_ic | |
dog=wn.synsets('dog', pos=wn.NOUN)[0] #get the first noun synonym of the word "dog" | |
cat=wn.synsets('cat', pos=wn.NOUN)[0] | |
rose=wn.synsets('rose', pos=wn.NOUN)[0] | |
flower=wn.synsets('flower', pos=wn.NOUN)[0] | |
brown_ic = wordnet_ic.ic('ic-brown.dat') #load the brown corpus to compute the IC |