Hi Experts,
I have a survey data which consist of text and there are almost 15,000 records. Can someone plz help and guide me how can i run NLTK key phrase extraction in power bi using python scripts.
I dont want to use Microsoft text analytics as my office dont want the data to go on ther ther server.
Using EDNA AI within the Enterprise DNA platform. Please see below.
Running NLTK Key Phrase Extraction in Power BI using Python Scripts
To run NLTK key phrase extraction in Power BI using Python scripts, you can follow these steps:
Load Your Survey Data into Power BI
Import your survey data into Power BI. Ensure that the text data is accessible in your Power BI report.
Set Up Python Environment in Power BI
Go to File -> Options and settings -> Options -> Python scripting.
Enable Python scripting by providing the path to your Python executable file.
Write Python Script for NLTK Key Phrase Extraction
Write a Python script that utilizes NLTK for key phrase extraction. Make sure your script includes the necessary NLTK libraries.
Here is a general outline of how your script might look:
import nltk
from nltk import word_tokenize
from nltk.util import ngrams
def extract_keyphrases(text):
# Tokenize the text
tokens = word_tokenize(text)
# Extract key phrases using NLTK ngrams
key_phrases = []
for i in range(1, 4): # Extract n-grams up to trigrams
key_phrases.extend([' '.join(ng) for ng in ngrams(tokens, i)])
return key_phrases
# Apply key phrase extraction function to each row of data
df['KeyPhrases'] = df['TextColumn'].apply(extract_keyphrases)
Integrate Python Script into Power BI
In Power BI, go to Transform Data -> Run Python Script.
Paste your Python script into the script editor and modify it to fit your data source and requirements.
Visualize Key Phrases in Power BI
Once the Python script runs successfully, you will have a new column in your dataset containing the extracted key phrases.
You can then create visuals in Power BI to analyze and visualize these key phrases as needed.
DataMentor is good tool to help you in your solution.
Thank you so much for the detailed answer and apologies for the late reply as i was not at work. I truly appreciate your time to reply to my post that gives me a starting point for my analysis.
Hi,
can you please guide me the name of the course where python setup in power bi is done. I have done the NLP which states to do the python - part 1 but cant find it.
Hi Keith,
Thank you for your message. I did the same to find out the NLP training.
But in the same training it is mentioned to “Python for Power BI Users”
and i assume that will be teach and guide how to setup python in power bi.
I searched with the same training name but nothing is coming hence request the assistance.
I might have found it its part of this course. They might have changed the name.
Data Wrangling & Visualization with Python for Power BI. They might have have discontinue/delete it too,