Sujit-O / pykg2vec

Python library for knowledge graph embedding and representation learning.
MIT License
602 stars 109 forks source link

how to limit number of triples ? #216

Open chetoui opened 2 years ago

chetoui commented 2 years ago

Hi, I'm a beginner with Pykg2vec, I try to limit the number of triples when I use Freebase15k from

{ tot_triple : 592213
      tot_valid_triples : 50000
       tot_test_triples : 59071
      tot_train_triples : 483142}

to something very small to reduce time of training

{ tot_triple : 30000, tot_valid_triples : 1500, tot_test_triples : 1500, tot_train_triples : 27000}

but I can't found I way to do this. i wonder if there a simple example to apply it in Train.py file .

chetoui commented 2 years ago

i already add this, but not working :

 kg_meta = KGMetaData(tot_triple =10000,
                         tot_train_triples=8000,
                         tot_test_triples=1000,
                         tot_valid_triples=1000)

    args = KGEArgParser().get_args(sys.argv[1:])
    # Preparing data and cache the data for later usage
    knowledge_graph = KnowledgeGraph(dataset=args.dataset_name,
                                     custom_dataset_path=args.dataset_path)
    knowledge_graph.kg_meta = kg_meta    
    knowledge_graph.prepare_data()