Open jeronimo13 opened 6 years ago
Hi, I have function
def bag_of_term(text): doc = textacy.Doc(text) bot = doc.to_bag_of_terms(ngrams=(2, 3, 4), named_entities=True, weighting='count', as_strings=True) print(bot.items()) return sorted(bot.items(), key=lambda x: x[1], reverse=True)
which works normally and returns ngrams on my machine
spacy
textacy
I use this function behind flask REST API
But when I run it inside Docker image and use it via REST endpoint I've got dict_items([('', 520)]) which I consider empty.
dict_items([('', 520)])
This is my docker looks like
FROM floydhub/textacy ## Install dependencies RUN pip --no-cache-dir install \ flask COPY . /app WORKDIR /app ENTRYPOINT ["python"] EXPOSE 8000 CMD ["app.py"]
I've tried several Dockerfile setups(including writing my own) and end up with written above, but all of them have this issue with empty doc.to_bag_of_terms
doc.to_bag_of_terms
Any ideas how to run textacy inside docker?
Hi, I have function
which works normally and returns ngrams on my machine
spacy
version: 2.0spacy
models: en_core_web_lgtextacy
version: latestI use this function behind flask REST API
But when I run it inside Docker image and use it via REST endpoint I've got
dict_items([('', 520)])
which I consider empty.This is my docker looks like
I've tried several Dockerfile setups(including writing my own) and end up with written above, but all of them have this issue with empty
doc.to_bag_of_terms
Any ideas how to run textacy inside docker?