Skip to content

could Matcher using python multiprocessing ?  #1871

Closed

Description

@meshiguge
No description provided.

Activity

  1. honnibal commented on Jan 28, 2018

    @honnibal
    Member

    Probably, yes. We're interested in trying multi-processing in Language.pipe() as well.

  2. meshiguge commented on Jan 31, 2018

    @meshiguge
    Author
    import spacy 
    nlp = spacy.load('en' )
    def task_builder(k,file):
          for line in file: 
              lineDoc = nlp(line) 
              matcher = Matcher( nlp.vocab ) 
              matcher.add('Pattern', None, pattern ) 
              matches = matcher( lineDoc ) 
              for each_match in matches:
                   do_something 
    
    pool = multiprocessing.Pool(process_num)
    for k, file in enumerate(files):
         pool.apply_async(task_builder, args=(k, file ) )
     pool.close()
     pool.join()

    @honnibal , but the code will hang out , could not work

  3. added
    feat / matcher
    on Mar 27, 2018
  4. added
    enhancement
    on Jul 6, 2018
  5. added
    perf / speed
    and removed on Aug 15, 2018
  6. added
    scaling
    on Oct 3, 2019
  7. svlandeg commented on Apr 1, 2020

    @svlandeg
    Contributor

    As a quick update, language.pipe() now supports multiprocessing by setting n_process to an integer > 1.

    PRs to have similar support for the Matcher are welcome!

  8. added
    help wanted
    and removed on Dec 10, 2020
  9. locked and limited conversation to collaborators on Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeat / matcherhelp wantedperf / speedscaling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions