8f2f0408337cf96ca3d737075068d870a3d0a36c,mordecai/geoparse.py,Geoparser,batch_geoparse,#Geoparser#,1029

Before Change


        if not self.threads:
            print("Error: can"t run batch_geoparse without setting threads = True.")
            return
        nlped_docs = nlp.pipe(text_list, multiprocessing.cpu_count())
        //pool = ThreadPool(self.n_threads)
        //processed = pool.map(self.geoparse, nlped_docs)
        //pool.close()
        //pool.join()

After Change


        
        if not self.threads:
            print("batch_geoparsed should be used with threaded searches. Please set `threads=True` when initializing the geoparser.")
        nlped_docs = list(nlp.pipe(text_list, as_tuples=False, n_threads=multiprocessing.cpu_count()))
        processed = []
        for i in tqdm(nlped_docs, disable=not self.progress):
            p = self.geoparse(i)
            processed.append(p)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: openeventdata/mordecai
Commit Name: 8f2f0408337cf96ca3d737075068d870a3d0a36c
Time: 2018-07-02
Author: ahalterman0@gmail.com
File Name: mordecai/geoparse.py
Class Name: Geoparser
Method Name: batch_geoparse


Project Name: explosion/spaCy
Commit Name: 46628d88903edaa2c3614339a0d464b9fcdcc690
Time: 2020-02-12
Author: sofie.vanlandeghem@gmail.com
File Name: spacy/tests/regression/test_issue4903.py
Class Name:
Method Name: test_issue4903


Project Name: explosion/spaCy
Commit Name: 1de61f68d645f0157f3902713bb69be1cf1421e2
Time: 2019-06-26
Author: sofie.vanlandeghem@gmail.com
File Name: examples/pipeline/wikidata_entity_linking.py
Class Name:
Method Name: _measure_accuracy