<jupyter_start><jupyter_text>Let's get down to bussiness  Setup basic properties<jupyter_code>lang = 'EN'
#key = 'find-your-own-key'
key = '<KEY>'
ls<jupyter_output>Volume in drive C is Windows
 Volume Serial Number is 92FD-5B19

 Directory of C:\Users\hp\Anaconda3\envs\minor\project1\Lib\site-packages

08-12-2018  21:04    <DIR>          .
08-12-2018  21:04    <DIR>          ..
08-12-2018  12:30    <DIR>          .idea
08-12-2018  14:56    <DIR>          .ipynb_checkpoints
08-12-2018  17:39    <DIR>          babelnet
08-12-2018  18:04            10,869 BabelNet.ipynb
08-12-2018  12:12    <DIR>          boto
08-12-2018  12:12    <DIR>          boto-2.49.0.dist-info
08-12-2018  12:12    <DIR>          boto3
08-12-2018  12:12    <DIR>          boto3-1.9.62.dist-info
08-12-2018  12:12    <DIR>          botocore
08-12-2018  12:12    <DIR>          botocore-1.12.62.dist-info
08-12-2018  20:14             2,716 build_emotion_vectors.py
08-12-2018  20:14             2,989 build_emotion_vectors.pyc
04-04-2016  13:03             1,823 build_sense_trees.py
07-12-2018  21:02             2,389 build_sense_trees.pyc
08-12-2018  12:11            18,340 bz2file[...]<jupyter_text>We will find tree for the following emotions<jupyter_code>from babelnet import utils
from babelnet.structures import Sense, Tree
from build_sense_trees import buildSenseTree, save, load
emotions = ['love', 'happiness', 'surprise', 'emotionless', 'sad', 'disgust', 'anger', 'fear']
#MODEL_PATH = 'C:/Users/hp/Anaconda3/envs/minor/project1/Lib/site-packages/babelnet/'
#print(MODEL_PATH + 'en' + '.pkl')
import pickle
#MODEL_PATH = '/home/models/babelnet/'
MODEL_PATH = 'C:/Users/hp/Anaconda3/envs/minor/project1/Lib/site-packages/babelnet/'
#MODEL_PATH = '/babelnet/'
trees_en = {}
trees_pl = {}
tree_depth = 3

for emotion in emotions:
    print 'Getting synsetIds for ' + emotion
    id = utils.getSynsetIds(emotion, 'EN', key)[0]
    
    print 'Building sense trees...'
    sense = Sense(id, emotion)   
    
    print 'Building english tree...'
    trees_en[emotion] = buildSenseTree(Tree(sense), 'EN', key, 3)
    
    print 'Saving english tree'
    filename = MODEL_PATH + emotion #+ '.pkl'
    fileobject = open(filename , 'wb')
    pickle.dump(trees_en[emotion] , fileobject)
    fileobject.close()
    
    
    #save(trees_en[emotion], MODEL_PATH + "en/" + emotion + '.pkl')
    
    #print 'Building polish tree..'
    #trees_pl[emotion] = buildSenseTree(Tree(sense), 'PL', key, 3)
    
    #print 'Saving polish tree'
    #save(trees_pl[emotion], MODEL_PATH + "pl/" + emotion + '.pkl')
    #filename = MODEL_PATH + "pl/" + emotion #+ '.pkl'
    #fileobject = open(filename , 'wb')
    #pickle.dump(trees_en[emotion] , fileobject)
    #fileobject.close()
    
    print 'Done!'
print trees_en['disgust']
#print trees_pl['disgust']<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1404553415061296, 'fraction_numerical': 0.0914185639229422, 'mean_word_length': 2.849056603773585, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '532605', 'license': 'MIT', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1072, 'n_words': 223, 'path': 'Sentiment Analysis/envs/BabelNet.ipynb', 'repo_name': 'G-akki26/Automatic-Subtitle-Media-Player', 'size': '2886'}