This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
def hello_w(): | |
ok | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
nlp=spacy.load('en_core_web_sm') | |
matcher = Matcher(nlp.vocab) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean_text(text, all_mentions): | |
# If retweet, delete RT and name of the account | |
text = re.sub('(RT\s.*):', '', text) | |
# Find all links and delete them | |
all_links = re.findall('(https:.*?)\s', text + ' ') | |
for i in all_links: | |
text = text.replace(i, '') | |
for i in all_mentions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
summary = [article['summary'] for article in articles] | |
sentence = summary[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_company_acquisition(headline_doc): | |
# check if the acquisition lemma (why lemma?) | |
for token in headline_doc: | |
if 'acquire' not in [token.lemma_ for token in headline_doc]: | |
return False | |
# check that at least 2 ORG entities | |
elif len([ent.label_ for ent in headline_doc.ents if ent.label_ == 'ORG']) < 2: | |
return False | |
return True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
# Build the container image | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', 'gcr.io/$PROJECT_ID/${_SERVICE_NAME}:${_VERSION}', '-f', './${_DIRECTORY_PROJECT}/Dockerfile', '.', '--build-arg', 'directory=${_DIRECTORY_PROJECT}','--build-arg', 'number_workers=${_NB_WORKERS}'] | |
# Push the container image to Container Registry | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['push', 'gcr.io/$PROJECT_ID/${_SERVICE_NAME}:${_VERSION}'] | |
# Deploy container image to Cloud Run | |
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' | |
entrypoint: gcloud |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Python36 | |
FROM python:3.6 | |
# Arguments | |
ARG directory | |
ARG number_workers # number of threads | |
WORKDIR /app | |
# Copy requirements.txt to the docker image and install packages |