poorna-kumar / gendermeme-core

A first open-sourced version of GenderMeme: https://gendermeme.org/
MIT License
6 stars 1 forks source link

Makes CoreNLP location configurable #7

Closed aendra-rininsland closed 6 years ago

aendra-rininsland commented 6 years ago

Currently the codebase assumes that CoreNLP will be situated on localhost, however, in a microservice architecture this probably isn't true.

This PR populates the hostname and port fields based on environment variables CORENLP_HOSTNAME and CORENLP_PORT. In their absence, it falls back to defaults localhost and 9000, respectively.

viswajithiii commented 6 years ago

Thanks for making this change! One small suggestion: would you mind making hostname also an argument to annotate_corenlp, and reading the env variables in the calling function and passing them on? I'd prefer for the annotate function to be callable with different ports and stuff without changing the environment (example: if you have multiple CoreNLP servers, and distribute your requests among them for speed up).

aendra-rininsland commented 6 years ago

Apologies for the delay! Have moved hostname to a kwarg of annotate_corenlp.