Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Commit

Permalink
build_knowledge : show in progress status
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-pr authored and starcolon committed Feb 14, 2017
1 parent 42910d5 commit ed14cd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build_knowledge.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ def iter_topic(crawl_collection,start):
patterns.load('./pos-patterns')

# Initialise a crawling dataset connection
print(colored('Initialising wikipedia crawling collection...'))
print(colored('Initialising wikipedia crawling collection...','cyan'))
crawl_collection = init_crawl_collection()

# Iterate through the crawling database
n = 0
print(colored('Iterating over crawling database...','cyan'))
bf = ScalableBloomFilter(mode=ScalableBloomFilter.SMALL_SET_GROWTH)
for topic,sentence in iter_topic(crawl_collection,args['start']):

Expand All @@ -105,5 +107,9 @@ def iter_topic(crawl_collection,start):

# Create a set of knowledge links
kb.add(topic,kb_nodes,args['verbose'])

n += 1
if n%100 == 0 and n>0:
print('... {} topics done so far.'.format(n))


0 comments on commit ed14cd3

Please sign in to comment.