original_docstring: 
      Main Function for link prediction task.
      :return:
      
docstring: Main Function for link prediction task.
docstring_tokens: Main Function for link prediction task .
code: def main():
      """
      Main Function for link prediction task.
      :return:
      """
      parser = argparse.ArgumentParser()
      parser.add_argument('--data_name', default='our_imdb')
      parser.add_argument('--norm', default='cosine')  # cosine / L2 Norm / L1 Norm
      parser.add_argument('--embedding', default='Node2Vec')  # Node2Vec / Event2Vec
      parser.add_argument('--false_per_true', default=10)
      parser.add_argument('--ratio', default=[0.8])
      args = parser.parse_args()
      # ratio_arr = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
      graph_maker = GraphImporter(args)
      graph = graph_maker.import_imdb_multi_graph()
      edges_preparation = EdgesPreparation(graph, args)
      dict_true_edges = edges_preparation.label_edges_classes_ordered()
      dict_false_edges = edges_preparation.make_false_label_edges(dict_true_edges)
      graph = edges_preparation.seen_graph()
      embeddings_maker = EmbeddingCreator(graph, args)
      if args.embedding == 'Node2Vec':
          dict_embeddings = embeddings_maker.create_node2vec_embeddings()
      elif args.embedding == 'Event2Vec':
          dict_embeddings = embeddings_maker.create_event2vec_embeddings()
      classifier = Classifier(dict_true_edges, dict_false_edges, dict_embeddings, args)
      classif, dict_class_movie_test = classifier.train()
      dict_class_measures_node2vec, pred, pred_true = classifier.evaluate(classif, dict_class_movie_test)
      classifier.confusion_matrix_maker(dict_class_measures_node2vec, pred, pred_true)
      with open(os.path.join(args.data_name, f'dict_class_measures_{args.embedding}_{args.norm}.pkl'), 'rb') as handle:
          dict_class_measures = pickle.load(handle)
      keys = list(dict_class_measures.keys())
      count = 0
      for key in keys:
          count += dict_class_measures[key]['acc']
      avg_acc = count / len(keys)
      print(f'avg. acc:{avg_acc}')
code_tokens: def main ( ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( '--data_name' , default = 'our_imdb' ) parser . add_argument ( '--norm' , default = 'cosine' ) parser . add_argument ( '--embedding' , default = 'Node2Vec' ) parser . add_argument ( '--false_per_true' , default = 10 ) parser . add_argument ( '--ratio' , default = [ 0.8 ] ) args = parser . parse_args ( ) graph_maker = GraphImporter ( args ) graph = graph_maker . import_imdb_multi_graph ( ) edges_preparation = EdgesPreparation ( graph , args ) dict_true_edges = edges_preparation . label_edges_classes_ordered ( ) dict_false_edges = edges_preparation . make_false_label_edges ( dict_true_edges ) graph = edges_preparation . seen_graph ( ) embeddings_maker = EmbeddingCreator ( graph , args ) if args . embedding == 'Node2Vec' : dict_embeddings = embeddings_maker . create_node2vec_embeddings ( ) elif args . embedding == 'Event2Vec' : dict_embeddings = embeddings_maker . create_event2vec_embeddings ( ) classifier = Classifier ( dict_true_edges , dict_false_edges , dict_embeddings , args ) classif , dict_class_movie_test = classifier . train ( ) dict_class_measures_node2vec , pred , pred_true = classifier . evaluate ( classif , dict_class_movie_test ) classifier . confusion_matrix_maker ( dict_class_measures_node2vec , pred , pred_true ) with open ( os . path . join ( args . data_name , f'dict_class_measures_{args.embedding}_{args.norm}.pkl' ) , 'rb' ) as handle : dict_class_measures = pickle . load ( handle ) keys = list ( dict_class_measures . keys ( ) ) count = 0 for key in keys : count += dict_class_measures [ key ] [ 'acc' ] avg_acc = count / len ( keys ) print ( f'avg. acc:{avg_acc}' )
short_docstring: Main Function for link prediction task.
short_docstring_tokens: Main Function for link prediction task .
comment: """
      Main Function for link prediction task.
      :return:
      """$SEP$# cosine / L2 Norm / L1 Norm$SEP$# Node2Vec / Event2Vec$SEP$# ratio_arr = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]