Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jayant Kodwani jayantkodwani

🏠
Working from home
View GitHub Profile
View Extract Text from Images Microsoft Computer Vision & Python
# -*- coding: utf-8 -*-
"""
Spyder Editor
INTRODUCTION
This is a script file to perform the following operations:
1.Use Microsoft Azure Computer vision Cognitive service to extract text from images (OCR) stored on Blob storage or any link.
2.Export the extracted text to an MS Excel file on your desktop for further analysis
pip install --upgrade azure-cognitiveservices-vision-computervision
@jayantkodwani
jayantkodwani / Key-phrase extraction and Integration in Power BI
Last active Feb 28, 2021
Key-phrase extraction and Integration in Power BI
View Key-phrase extraction and Integration in Power BI
"""
@author: Jayant Kumar Kodwani
"""
# 'dataset' holds the input data for this script
import RAKE
import pandas as pd
"""Add stopwords list, REPLACE path as required"""
@jayantkodwani
jayantkodwani / DAX
Created Feb 20, 2021
DAX Code to create single column for sentiments
View DAX
Overall Sentiment = IF(Responses[Sentiment.positive]=1,"Positive",IF(Responses[Sentiment.neutral]=1,"Neutral",IF(Responses[Sentiment.negative]=1,"Negative","NA")))
@jayantkodwani
jayantkodwani / Sentiment Analysis Azure API M query.txt
Last active Feb 20, 2021
Sentiment Azure API (M Query for PBI Custom Function)
View Sentiment Analysis Azure API M query.txt
= (text) => let
apikey = "<<Replace your APIKey here>>",
endpoint = "<<Replace your endpoint link here>>",
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ] }",
bytesbody = Text.ToBinary(jsonbody),
headers = [#"Ocp-Apim-Subscription-Key" = apikey],
bytesresp = Web.Contents(endpoint, [Headers=headers, Content=bytesbody]),
jsonresp = Json.Document(bytesresp),
sentiment = jsonresp[documents]{0}[confidenceScores]