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
cloud_category = url.split('/')[4] |
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
data = requests.get(url) | |
soup = BeautifulSoup(data.content, 'html.parser') | |
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
news_blogs = [{'news_headline': headline.find('div', | |
attrs={"class": "blog-title"}).string, | |
'news_blog': blog.find('div', | |
attrs={"class": "preview-text"}).string, | |
'cloud_category': cloud_category} | |
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
df = pd.DataFrame(cortezcloud_data) | |
df = df[['news_headline', 'news_blog', 'cloud_category']] | |
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
ultimos_posts = ingestar_noticias(cortezcloud_urls) | |
ultimos_posts.head(10) | |
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
(nlp01) ➜ comprehend-01-nlpseries-ep-3 sudo sam deploy --guided | |
Configuring SAM deploy | |
====================== | |
Looking for samconfig.toml : Found | |
Reading default arguments : Success | |
Setting default arguments for 'sam deploy' | |
========================================= |
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
curl -X POST \ | |
https://d5601zkukf.execute-api.ca-central-1.amazonaws.com/Prod/sentiment \ | |
-H 'cache-control: no-cache' \ | |
-H 'content-type: application/json' \ | |
-H 'postman-token: ea059b31-e081-24e6-8911-c179362ee99c' \ | |
-d '{"body": "{\"Body\":\"estoy de humor bueno\"}"}' |
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
➜ comprehend-nlp01 brew upgrade aws-sam-cli | |
Warning: aws/tap/aws-sam-cli 1.13.2 already installed |
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
➜ comprehend-nlp01 virtualenv -p `which python3.6` nlp01 | |
created virtual environment CPython3.6.5.final.0-64 in 486ms | |
creator CPython3Posix(dest=/Users/carlos/repos/cc/nlp/comprehend-nlp01/nlp01, clear=False, global=False) | |
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/carlos/Library/Application Support/virtualenv) | |
added seed packages: pip==20.1.1, setuptools==47.3.1, wheel==0.34.2 | |
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator |
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 json | |
import boto3 | |
#Using boto3 to call the Comprehend API | |
client = boto3.client('comprehend') | |
#Lambda function to work with Comprehend | |
def lambda_handler(event, context): | |
print("event puro:", event) |