I was working with the TabPy interface to display my python code output onto Tableau.
I wrote a Python function which will reduce the themes from the given sentences using NLP. It works perfectly fine in my Jupyter notebook. But when I try executing the same in Tableau, it shows the error : " No return value."
This is my function which needs to be executed :
"def display_topics2(model, feature_names, documents, no_top_words, no_top_documents,countv=tfidf):
for topic_idx, topic in enumerate(model.components_):
print ('\033[1m' + 'Topic %d:' % (topic_idx) + '\033[0;0m')
print ('\033[1m' + ' '.join([feature_names[i]
for i in topic.argsort()[:-no_top_words - 1:-1]]) + '\033[0;0m')
top_doc_indices = np.argsort(model.transform(countv)[:,topic_idx] )[::-1][0:no_top_documents]
for doc_index in top_doc_indices:
print (' ')
display_topics2(nmf, tfidf_feature_names, documents, no_top_words, no_top_documents,tfidf)
Can you please help me out on how to just simply display the print statements output on Tableau? Appending on lists won't work either.
Please find attached the image as well along with the comment.