Created
March 31, 2021 16:33
-
-
Save NesrineSF/436e7b1395e0099a4ba45f469f96a5cd to your computer and use it in GitHub Desktop.
concept_ID for each word "object" within the knowledge graph
This file contains 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
#Concept_ID for object_noun | |
print (f'\t \033[1mConcept_ID for object when NOUN \033[0m \n') | |
#to print TOKEN, POS and ID (for the concept) in bold at the beginning of the output array: | |
print (f'\033[1m{"TOKEN":{20}} {"POS":{15}} {"ID":{6}}\033[0m') | |
#Syncon stands for "Concept" that we refer to with an ID | |
for token in output.tokens: | |
print (f'{object_noun[token.start:token.end]:{20}} {token.pos:{15}} {token.syncon:{6}} ') | |
#Concept_ID for object_verb | |
print (f'\t \033[1mConcept_ID for object when VERB \033[0m \n') | |
#to print TOKEN, POS and ID (for the concept) in bold at the beginning of the output array: | |
print (f'\033[1m{"TOKEN":{20}} {"POS":{15}} {"ID":{6}}\033[0m') | |
#Syncon stands for "Concept" that we refer to with an ID | |
for token in output_2.tokens: | |
print (f'{object_verb[token.start:token.end]:{20}} {token.pos:{15}} {token.syncon:{6}} ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment