text
stringlengths
0
27.6k
python
int64
0
1
DeepLearning or NLP
int64
0
1
Other
int64
0
1
Machine Learning
int64
0
1
Mathematics
int64
0
1
Trash
int64
0
1
I am setting up nlp preprocessing using pretrained FastText model to query and save word vectors. I ran into FileNotFoundError: [Errno 2] No such file or directory: 'fasttext': 'fasttext' and unable resolve it at this point. This is for a nlp clinical text similarity project that I am working on. I doubled checked to...
1
1
0
0
0
0
Below code is an example training loop for SpaCy's named entity recognition(NER). for itn in range(100): random.shuffle(train_data) for raw_text, entity_offsets in train_data: doc = nlp.make_doc(raw_text) gold = GoldParse(doc, entities=entity_offsets) nlp.update([doc], [gold], drop=0.5,...
1
1
0
0
0
0
I want to read some text file and Find out how many times each word is repeated per line? this is my text file خواب خودرو چگونه محاسبه می گردد؟ برای دریافت آن چه باید كرد؟ مهلت زمانی تامین قطعه پس از درخواست مشتری چند روز است؟ آیا در مراجعه مجدد برای ایرادی كه پس از تعمیرات رفع نشده است باید هزینه ای پرداخت گردد؟ چرا؟...
1
1
0
0
0
0
I am trying to understand, how to use BERT for QnA and found a tutorial on how to start on PyTorch (here). Now I would like to use these snippets to get started, but i do not understand how to project the output back on the example text. text = "[CLS] Who was Jim Henson ? [SEP] Jim Henson was a puppeteer [SEP]" (...)...
1
1
0
0
0
0
I am creating a camera application using opencv and pyautogui.The function is not getting evaluated. from utils import CFEVideoConf, image_resize def recog(): cap = cv2.VideoCapture(0) save_path = 'saved-media/video.avi' frames_per_seconds = 24.0 config = CFEVideoConf(cap, filepath=save_path, res='720...
1
1
0
0
0
0
I am using the latest version of spacy_hunspell with Portuguese dictionaries. And, I realized that when I have inflected verbs containing special characters, such as the acute accent (`) and the tilde (~), the spellchecker fails to retrieve the correct verification: import hunspell spellchecker = hunspell.HunSpell('/u...
1
1
0
0
0
0
I have around 20k documents with 60 - 150 words. Out of these 20K documents, there are 400 documents for which the similar document are known. These 400 documents serve as my test data. I am trying to find similar documents for these 400 datasets using gensim doc2vec. The paper "Distributed Representations of Sentences...
1
1
0
0
0
0
I am planning to build an AI system that learns from the corpus (text file) and needs to answer to question for user like chatbot to be short chatbot without any predefined data. Until now I webscraped some data and stored as a text file and I used TF-IDF(cosine similarity) method to make the system to answer questions...
1
1
0
0
0
0
Hello I have been trying to contextual extract word embedding using the novel XLNet but without luck. Running on Google Colab with TPU I would like to note that I get this error when I use TPU so thus I switch to GPU to avoid the error xlnet_config = xlnet.XLNetConfig(json_path=FLAGS.model_config_path) AttributeError...
1
1
0
0
0
0
I am working on a way to classify mail by using Keras. I read the mail that have already been classified, tokenize them to create a dictionary which is link to a folder. So I created a dataframe with pandas: data = pd.DataFrame(list(zip(lst, lst2)), columns=['text', 'folder']) The text column is where reside all the w...
1
1
0
1
0
0
I'm new to Tensorflow and AI, so I'm having trouble researching my question. Either that, or my question hasn't been answered. I'm trying to make a text classifier to put websites into categories based on their keywords. I have at minimum 5,000 sites and maximum 37,000 sites to train with. What I'm trying to accomplish...
1
1
0
0
0
0
I get a UserWarning thrown every time I execute this function. Here user_input is a list of words, and article_sentences a list of lists of words. I've tried to remove all stop words out of the list beforehand but this didn't change anything. def generate_response(user_input): sidekick_response = '' article_sen...
1
1
0
0
0
0
I wanted to transform a dataset or create a new one that takes a dataset column with labels as input which automatically has sequences of strings according to a pre-defined length (and pads if necessary). The example below should demonstrate what I mean. I was able to manually create a new dataframe based on ngrams. Th...
1
1
0
0
0
0
So I'm using the spacy library (NLP), to assign certain attributes to data. But it's a lot of data (100,000+ questions and answers). It takes about a minute to assign attributes to all the data. I was wondering if I could save the data with the given attributes somewhere, and next time I compile it doesn't need to spen...
1
1
0
0
0
0
In Spacy NLP, I am not able to get exact output for named entity. My string value is on multiple lines. Please check below code: from spacy import displacy from collections import Counter import en_core_web_sm nlp = en_core_web_sm.load() m = (u"""Release the container 6th August USG11223 USG12224 USG21113""") doc = n...
1
1
0
0
0
0
In the chapter seven of this book "TensorFlow Machine Learning Cookbook" the author in pre-processing data uses fit_transform function of scikit-learn to get the tfidf features of text for training. The author gives all text data to the function before separating it into train and test. Is it a true action or we must s...
1
1
0
1
0
0
I am trying to create cluster out of text contained in an excel file but I'm getting the error "AttributeError: 'int' object has no attribute 'lower'". Sample.xlsx is a file containing data like this: I have created a list called corpus which has unique text according to each row and I get that problem while vectorizi...
1
1
0
0
0
0
I have created a model using this dataset and I would like to insert some sentences to see how they would be classified. How can I do that? Here is the code that makes the model: from sklearn.datasets import fetch_20newsgroups from sklearn.naive_bayes import MultinomialNB from sklearn.feature_extraction.text import Tfi...
1
1
0
0
0
0
i created the class webviewThread in which i have created the run function in which i am passing 2 arguments "self, openWhat" but it gives error on runtime. here is my code class webviewThread(Thread): def run(self,openWhat): if openWhat=="facebook": webview.create_window('Facebook', 'http://w...
1
1
0
0
0
0
I'm working on a project to read the text and make a prediction of the outcome. As part of cleaning the data I am trying to remove all of the stopwords. When I try to do this, I need the output to be in a datafram format but I am running into issues there. So, after much cleaning I got the data to the point where it lo...
1
1
0
0
0
0
I am working on an NLP task that requires using a corpus of the language called Yoruba. Yoruba is a language that has diacritics (accents) and under dots in its alphabets. For instance, this is a Yoruba string: "ọmọàbúròẹlẹ́wà", and I need to remove the accents and keep the under dots. I have tried using the unidecode ...
1
1
0
0
0
0
How would one go about extracting text from documents such as a job application and have it sorted into a nice data set with feature such as dob/SSN/ address/ etc etc. With each field in the application serving as a column for my data set?
1
1
0
1
0
0
Am working on sentiment analysis problem. Tried to use autocorrect but that requires a lot computing power which I don't have access to because of the size of corpus. So came up with a different approach of solving the problem by creating a dictionary of {key = 'incorrect', value = 'correct'} and then manually correcti...
1
1
0
1
0
0
I am trying to do anaphora resolution and for that below is my code. first i navigate to the folder where i have downloaded the stanford module. Then i run the command in command prompt to initialize stanford nlp module java -mx4g -cp "*;stanford-corenlp-full-2017-06-09/*" edu.stanford.nlp.pipeline.StanfordCoreNLPServe...
1
1
0
0
0
0
I'm working in some kind of NLP. I compare a daframe of articles with inputs words. The main goal is classify text if a bunch of words were found I've tried to extract the values in the dictionary and convert into a list and then apply stemming to it. The problem is that later I'll do another process to split and compa...
1
1
0
0
0
0
When extracting keywords from a text, I realized that I get back mostly the same words in different formats. Is there a way to enable the same word to show up only once? Example: updated updates update updating | research researched researchers | files filed file Code: Summa (TextRank) package used here: k_words = ...
1
1
0
0
0
0
I have to identify cities in a document (has only characters), I do not want to maintain an entire vocabulary as it is not a practical solution. I also do not have Azure text analytics api account. I have already tried using Spacy, I did ner and identified geolocation and that output is passed to spellchecker() to tr...
1
1
0
0
0
0
In most cases, I am finding that polarity_scores returning output as "Neutral" whereas there should be some % of negative and positive sentiments highlighted e.g. consider the following cases, I found {'neg': 0.0, 'neu': 1.0, 'pos': 0.0, 'compound': 0.0} for all the 3 cases mentioned below. case 1: the renewal manage...
1
1
0
0
0
0
I'm trying to download Google's new pretrained multilingual universal sentence encoder that was just published July this year. I have followed the test found at their website using Colab and works well, but when I try to do it locally it hangs forever while trying to download it (code copied from tf's site): import te...
1
1
0
0
0
0
I am begginer with NLP. I am using spaCy python library for my NLP project. Here is my requirement, I have a JSON File with all country names. Now i need to parse and get goldmedal count for the each countries in the document. Given below the sample sentence, "Czech Republic won 5 gold medals at olympics. Slovakia won ...
1
1
0
0
0
0
I have a bit of code that uses newspaper to go take a look at various media outlets and download articles from them. This has been working fine for a long time but has recently started acting up. I can see what the problem is but as I'm new to Python I'm not sure about the best way to address it. Basically (I think) I ...
1
1
0
0
0
0
I want to build a word cloud containing multiple word structures (not just one word). In any given text we will have bigger frequencies for unigrams than bigrams. Actually, the n-gram frequency decreases when n increases for the same text. I want to find a magic number or a method to obtain comparative results between ...
1
1
0
0
0
0
I'm trying to reproduce a study into sentiment analysis which uses dependency structures which were generated using the Stanford NLP library, the issue is that the study is from 2011 and I've found that than the Standford library used Stanford Dependencies but it now uses Universal Dependencies which gives different re...
1
1
0
0
0
0
I am trying to build the input for the saved model from BERT-SQuAD given that I have got all the elements for the input. I fine-tuned a question answering model by running of run_squad.py in Google bert, then I exported the model with export_saved_model. Now when I have a new context and question, I can't build the cor...
1
1
0
0
0
0
I want to split a sentence into a list of words. For English and European languages this is easy, just use split() >>> "This is a sentence.".split() ['This', 'is', 'a', 'sentence.'] But I also need to deal with sentences in languages such as Chinese that don't use whitespace as word separator. >>> u"这是一个句子".split() [u...
1
1
0
0
0
0
Given a DBpedia resource, I want to find the entire taxonomy till root. For example, if I were to say in plain English, for Barack Obama I want to know the entire taxonomy which goes as Barack Obama → Politician → Person → Being. I have written the following recursive function for the same: import requests import ...
1
1
0
0
0
0
I am building Dataflow job to get data from cloud storage and pass it to NLP API to perform sentiment analysis and import the result to BigQuery The Job ran successfully localy (I didn't use data flow runner) import apache_beam as beam import logging from google.cloud import language from google.cloud.language import...
1
1
0
0
0
0
Python3.6: I am using Spacy on a column of text in a pandas df. The text does have "Special Characters" and I need to keep them. nlp required unicode for some reason. I am getting an error from nlp below: Any help would be very much appreciated. # -*- coding: utf-8 -*- import spacy nlp = spacy.load("en_core_web_sm") d...
1
1
0
0
0
0
My dataframe has thousands of rows. It look like this: import pandas as pd import numpy as np text = ['please send us a dm...','…could you please dm me','dm me plz…','i dmed u yesterday…','dm me asap thx', 'i send a dm to u now', 'thx u r so nice dming u now', 'just sent u a dm'] df = pd.DataFrame({"text": text}) ...
1
1
0
0
0
0
In the description of the fasttext library for python https://github.com/facebookresearch/fastText/tree/master/python for training a supervised model there are different arguments, where among others are stated as: ws: size of the context window wordNgrams: max length of word ngram. If I understand it right, both of ...
1
1
0
0
0
0
I am trying to print the bigrams for a text in Python 3.5. The text is already pre-processed and split into individual words. I tried two different ways (shown below), neither work. The first: ninety_seven=df.loc[97] nine_bi=ngrams(ninety_seven,2) print(nine_bi) This outputs: < generator object ngrams at 0x0B4F9E70> ...
1
1
0
0
0
0
NLTK Mutli word tokenzier works is case sensitive. I want to work for both upper and lower case tk.add_mwe(('The', 'questions')) works for the word The questions But fails for the word the questions Plz give a solution or an alternate
1
1
0
0
0
0
I have a list of properties, name:value style. The name and value could be anything. I would like to generate gramatically correct descriptive text that considers the entire set of name:value pairs. The generator should be smart enough to recognize the type of the property based on the property name and generate approp...
1
1
0
0
0
0
I am analyzing the call records and try to use doc2vec I cant find the appropriate way to apply I tried to convert words to root later i will try to get rid of stop words(which are rooted). I desire to understand that each what the conversation is about(that can be a few or more words).Can you suggest me a certain way...
1
1
0
0
0
0
I'm trying to input a sentence and classify it as a 1 or 0. I have data with two columns, the first is the sentence text (e.g. "This is a sentence") and the second column is a classification (e.g. 0 or 1). I have predicted values that I'm trying to interpret, only I can't seem to understand the X axis of my graph and ...
1
1
0
1
0
0
I'm trying to filter my dataset which contains nearly 50K articles. From each article I want to filter out stop words and punctuation. But the process is taking long time. I've already filtered the dataset and it took 6 hours. Now I've got another dataset to filter which contains 300K articles. I'm using python in anac...
1
1
0
0
0
0
I am classifying text with 2 categories. One is imperatives, and the other one is non-imperatives. I prepared my text in the way Naive Bayes Classifier needs. But, now, I also need to use SVM. What should I do here? (I need to classify the text and calculate the accuracy, too.)Thank you for reading and trying to answer...
1
1
0
0
0
0
Given a 3d tenzor, say: batch x sentence length x embedding dim a = torch.rand((10, 1000, 96)) and an array(or tensor) of actual lengths for each sentence lengths = torch .randint(1000,(10,)) outputs tensor([ 370., 502., 652., 859., 545., 964., 566., 576.,1000., 803.]) How to fill tensor ‘a’ with zeros after certai...
1
1
0
0
0
0
I'm building a classifier for a QA bot, and have a dataset for 8k questions, and 149 different Answers. I got some problems when training my model; the "loss" won't go down as I expected so I am asking for your help... Here is my method: I use word2vec to get a word's vector, then use a GRU-based network to get the ve...
1
1
0
0
0
0
I am new to NLP and trying to do some pre-processing steps on my data for a classification task. I have already done most of the cleaning but there still are some special characters within the text that I am now trying to remove. The text is in a Dataframe and is already tokenized and lemmatized, converted to lowerca...
1
1
0
0
0
0
I've been trying to install Python package pyrouge for a while. Finally by following all these steps here I installed. It was the most helpful answer related to pyrouge I have seen so far. It does not give any error, I can import Rouge155 successfully. However when I try to do the same test as in step 8(with the same c...
1
1
0
0
0
0
I am trying to train an NLP model on one set, save the vocab and the model, then apply it to a separate validation set. The code is running, but how can I be sure it is working as I expect? In other words, I have saved a vocab and nmodel from the training set, then I created the TFidfVectorizer with saved vocabulary, ...
1
1
0
0
0
0
I would like to classify comments based on NLP algorithm (tf-idf). I managed to classify these clusters but I want to visualize them graphically (histogram, scatter plot...) import collections from nltk import word_tokenize from nltk.corpus import stopwords from nltk.stem import PorterStemmer from sklearn.cluster impo...
1
1
0
0
0
0
I am trying to use a pre-trained BERT model for fine tuning with SST2 data processor. But when I give the checkpoint of the pre-trained model, it is showing that "Key output_bias not found in checkpoint". I thought it might be due to errors in the pre-trained BERT model checkpoint. So I did the pre-training again. But,...
1
1
0
0
0
0
I am practising NLP and checking using the below function what are the most frequent words per category and then observe how some sentences would be classified. The results are surprisingly wrong (Do you have to suggest another way of doing this helpful part of finding most frequent words per category?): #The function ...
1
1
0
0
0
0
I am trying to extract text between two iterators. I have tried using span() function on it to find the start and the end span How do I proceed further, to extract text between these spans start_matches = start_pattern.finditer(filter_lines) end_matches = end_pattern.finditer(filter_lines) for s_match in start_...
1
1
0
0
0
0
Edit due to off-topic I want to use regex in SpaCy to find any combination of (Accrued or accrued or Annual or annual) leave by this code: from spacy.matcher import Matcher nlp = spacy.load('en_core_web_sm') matcher = Matcher(nlp.vocab) # Add the pattern to the matcher matcher.add('LEAVE', None, [{'TEXT'...
1
1
0
0
0
0
I have a fairly simple NLTK and sklearn classifier (I'm a complete noob at this). I do the usual imports import pandas as pd import matplotlib.pyplot as plt from sklearn.feature_extraction.text import CountVectorizer from nltk.tokenize import RegexpTokenizer from sklearn.model_selection import train_test_split from...
1
1
0
0
0
0
For training new custom entities we can train a model using the steps mentioned here: https://spacy.io/usage/training#ner But I want to know how to decide no of iterations, drop and batch size to overfit or underfit the model? One example of loss is: Starting training.... Losses: {'ner': 3875.2103796127717} Losses: {...
1
1
0
0
0
0
I want to know if there is an elegant way to get the index of an Entity with respect to a Sentence. I know I can get the index of an Entity in a string using ent.start_char and ent.end_char, but that value is with respect to the entire string. import spacy nlp = spacy.load("en_core_web_sm") doc = nlp(u"Apple is lookin...
1
1
0
0
0
0
Python sklearn CountVectorizer has an "analyzer" parameter which has a "char_wb" option. According to the definition, "Option ‘char_wb’ creates character n-grams only from text inside word boundaries; n-grams at the edges of words are padded with space.". My question here is, how does CountVectorizer identify a "wor...
1
1
0
0
0
0
this question is about classification of texts based on common words, I don't know if I am approaching the problem right I have an excel with texts in the "Description" column and a unique ID in the "ID" column, I want to iterate through Descriptions and compare them based on percentage or frequency of common words in...
1
1
0
0
0
0
I have this text: data = ['Hi, this is XYZ and XYZABC is $$running'] I am using the following tfidfvectorizer: vectorizer = TfidfVectorizer( stop_words='english', use_idf=False, norm=None, min_df=1, tokenizer = tokenize, ngram_range=(1, 1), ...
1
1
0
1
0
0
The final call of pyterresect is not returning an string instead its printing values of every pixel of that image only. import numpy as np import cv2 import imutils from PIL import Image from pytesseract import image_to_string count = 0 for c in cnts: peri = cv2.arcLength(c, True) approx = cv2.approxP...
1
1
0
1
0
0
How we I stop word_tokenize from splittings strings like "pass_word", "https://www.gmail.com" and "tempemail@mail.com"? The quotes should prevent it, but they don't. I have tried with different regex options. from nltk import word_tokenize s = 'open "https://www.gmail.com" url. Enter "tempemail@mail.com" in email. En...
1
1
0
0
0
0
Can't figure out why is this problem appearing. from mosestokenizer import MosesDetokenizer with MosesDetokenizer('en') as detokenize: print(detokenize(["hi", 'my', 'name', 'is', 'artem'])) This is what I get: stdbuf was not found; communication with perl may hang due to stdio buffering. Traceback (most recent ca...
1
1
0
0
0
0
I'm trying to build a predictive model (random forest, sgd, etc.) using scikit-learn and it seems like every model only allows you to fit text data such as classifier.fit(X,Y) ...where Y is the target and X is a text feature vector (count_vec -> tf_idf). Is there any way to have a model which in addition to the text ...
1
1
0
0
0
0
I have two data frames (df1 and df2), each with the columns "Words" and "Frequency". For each word in df1, I want to see if it exists in df2 and then return the "Frequency" value so that it can be appended to include the new instances from df1. And if the word does not exist in df2, then add it. I have found ways of a...
1
1
0
0
0
0
I got two descriptions, one in a dataframe and other that is a list of words and I need to compute the levensthein distance of each word in the description against each word in the list and return the count of the result of the levensthein distance that is equal to 0 import pandas as pd definitions=['very','similarit...
1
1
0
0
0
0
I've built a text classifier using FastAi on Kaggle, while trying to export the trained model i get the following error - TypeError: unsupported operand type(s) for /: 'str' and 'str' I've tried setting the leaner model directory and path to working directory. learn_clas.path='/kaggle/working/' learn_clas.model_dir='/...
1
1
0
0
0
0
I am training a LSTM in-order to classify the time-series data into 2 classes(0 and 1).I have huge data-set on the drive where where the 0-class and the 1-class data are located in different folders.I am trying to train the LSTM batch-wise using by creating a Dataset class and wrapping the DataLoader around it. I have ...
1
1
0
1
0
0
I have a corpus of free text medical narratives, for which I am going to use for a classification task, right now for about 4200 records. To begin, I wish to create word embeddings using w2v, but I have a question about a train-test split for this task. When I train the w2v model, is it appropriate to use all of the ...
1
1
0
1
0
0
I am having trouble with my performance doing nlp tasks. I want to use this module for word embeddings and it produces output, but its runtime increases with each iterative call. I have already read about different solutions, but i cant get them to work. I suspect using tf.placeholders would be the a good solution, but...
1
1
0
0
0
0
I would like to use a pre-trained word2vec model in Spacy to encode titles by (1) mapping words to their vector embeddings and (2) perform the mean of word embeddings. To do this I use the following code: import spacy nlp = spacy.load('myspacy.bioword2vec.model') sentence = "I love Stack Overflow butitsalsodistractiv...
1
1
0
0
0
0
Is there a way to use spaCy's rule-based pattern matcher (or a similar library) on dependency sequences such as the list of tokens returned by token.ancestors? For example, I have pluralized a noun and now I need to check for dependent verbs to fix any errors in verb agreement. So one pattern (of many) would be to mat...
1
1
0
0
0
0
I have array reshape and sizes issue I haven't try anything due to the reason I am still new in this and I dont want to mess up things that are unreleated to the issue import tensorflow as tf import numpy as np mnist = tf.keras.datasets.mnist (x_train, y_train),(x_test, y_test) = mnist.load_data() x_train = tf.keras...
1
1
0
0
0
0
I have two data frames. Each contains 1 word per row. They are pretty close, but there are misspellings and sometimes one df has one or two words the other doesn't. As a rule, I want to combine df2.word with df1.metadata. If df2.word and df1.word match, are close in spelling, or are close enough and within 1 row from ...
1
1
0
0
0
0
Using gensim I was able to extract topics from a set of documents in LSA but how do I access the topics generated from the LDA models? When printing the lda.print_topics(10) the code gave the following error because print_topics() return a NoneType: Traceback (most recent call last): File "/home/alvas/workspace/XLING...
1
1
0
0
0
0
I'm using the NLTK WordNet Lemmatizer for a Part-of-Speech tagging project by first modifying each word in the training corpus to its stem (in place modification), and then training only on the new corpus. However, I found that the lemmatizer is not functioning as I expected it to. For example, the word loves is lemmat...
1
1
0
0
0
0
I'm currently trying to build a sentence parser that extracts unknown parts of speech. Its a bit abstract but my methodology is basically creating a set of grammatical rules that the function can use to parse the text. I'm using Spacy's PoS tagger right now just to extract the pos tags from an example sentence. I know ...
1
1
0
0
0
0
I have some sample images. How to extract tabular data from images and store it into JSON format?
1
1
0
1
0
0
Given that I have a string like: 'velvet evening purse bags' how can I get all word pairs of this? In other words, all 2-word combinations of this: 'velvet evening' 'velvet purse' 'velvet bags' 'evening purse' 'evening bags' 'purse bags' I know python's nltk package can give the bigrams but I'm looking for something...
1
1
0
0
0
0
I tried to load pre-trained model by using BertModel class in pytorch. I have _six.py under torch, but it still shows module 'torch' has no attribute '_six' import torch from pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM # Load pre-trained model (weights) model = BertModel.from_pretrained('be...
1
1
0
0
0
0
I have a list of tuples that are generated from a string using NLTK's PoS tagger. I'm trying to find the the "intent" of a specific string in order to append it to a dataframe, so I need a way to generate a syntax/grammar rule. string = "RED WHITE AND BLUE" string_list = nltk.pos_tag(a.split()) string_list = [('RED'...
1
1
0
0
0
0
I have dataframe with description column, under one row of description there are multiple lines of texts, basically those are set of information for each record. Example: Regarding information no 1 at 07-01-2019 we got update as the sky is blue and at 05-22-2019 we again got update as Apples are red, that are arrange...
1
1
0
0
0
0
I work in customer support, and I'm using scikit-learn to predict tags for our tickets, given a training set of tickets (approx. 40,000 tickets in the training set). I'm using the classification model based on this one. It's predicting just "()" as the tags for many of my test set of tickets, even though none of the ti...
1
1
0
0
0
0
I am trying to clean up tweets to analyze their sentiments. I want to turn emojis to what they mean. For instance, I want my code to convert 'I ❤ New York' 'Python is ' to 'I love New York' 'Python is cool' I have seen packages such as emoji but they turn the emoji's to what they represent, not what they mean. fo...
1
1
0
0
0
0
I am using nltk PunktSentenceTokenizer for splitting paragraphs into sentences. I have paragraphs as follows: paragraphs = "1. Candidate is very poor in mathematics. 2. Interpersonal skills are good. 3. Very enthusiastic about social work" Output: ['1.', 'Candidate is very poor in mathematics.', '2.', 'Interpersonal s...
1
1
0
0
0
0
I am new in NLP domain and was going through this blog: https://blog.goodaudience.com/learn-natural-language-processing-from-scratch-7893314725ff London is the capital of and largest city in England and the United Kingdom. Standing on the River Thames in the south-east of England, at the head of its 50-mile (80 k...
1
1
0
0
0
0
I am trying to implement a tf-idf vectorizer from scratch in Python. I computed my TDF values but the values do not match with the TDF values computed using sklearn's TfidfVectorizer(). What am I doing wrong? corpus = [ 'this is the first document', 'this document is the second document', 'and this is the third one'...
1
1
0
1
0
0
Is it possible to load a packaged spacy model (i.e. foo.tar.gz) directly from the tar file instead of installing it beforehand? I would imagine something like: import spacy nlp = spacy.load(/some/path/foo.tar.gz)
1
1
0
0
0
0
Is it possible to use Stanford Parser in NLTK? (I am not talking about Stanford POS.)
1
1
0
0
0
0
I have a large forum about dog with tagged posts. Index scores from document frequency * text frequency gives me a perfect measure of what a topic should be about. For example print (getscores('dog food')) # keyword scores range between 1 and 2 # {'dog':2,'food':1.8,'bowl':1.7,'consumption':1.5, ..... 'like':1.00001} ...
1
1
0
0
0
0
I have installed the latest version of nlpnet library (http://nilc.icmc.usp.br/nlpnet/). Then, when I try to use nlpnet POSTagger according to the follwoing example, I get an error: import nlpnet tagger = nlpnet.POSTagger('/path/to/pos-model/', language='pt') Error: Traceback (most recent call last): File "<stdin>", ...
1
1
0
0
0
0
I'm working on linear regression algorithm with multiple variables using Numpy library for Matrix. My problem is that matrix.item((i,j)) is not working properly.here is python shell: >>> a=h(Data,0,Theta) >>> a matrix([[3.78]]) >>> a.item((0,0)) 3.7800000000000002 As you see the output value is 0.0000000000000002 bigg...
1
1
0
0
0
0
This is an abstract idea, I dont know the correct pipeline for implementing; I have used a RestNet50 architecture for training a model to classify image into 3 categories; one of the ways i was thinking of exploring was using the textual data of the image; train_gen = image.ImageDataGenerator().flow_from_directory(data...
1
1
0
0
0
0
I've trained a Doc2Vec model in order to do a simple binary classification task, but I would also love to see which words or sentences weigh more in terms of contributing to the meaning of a given text. So far I had no luck finding anything relevant or helpful. Any ideas how could I implement this feature? Should I swi...
1
1
0
0
0
0
I'm trying to categorize customer feedback and I ran an LDA in python and got the following output for 10 topics: (0, u'0.559*"delivery" + 0.124*"area" + 0.018*"mile" + 0.016*"option" + 0.012*"partner" + 0.011*"traffic" + 0.011*"hub" + 0.011*"thanks" + 0.010*"city" + 0.009*"way"') (1, u'0.397*"package" + 0.073*"address...
1
1
0
0
0
0
I want to write topic lists to check whether a review talks about one of the defined topics. It's important for me to write the topic lists myself and not use topic modeling to find possible topics. I thought this is called dictionary analysis, but I can't find anything. I have a data frame with reviews from amazon: df...
1
1
0
0
0
0
I am working on Pre trained word vectors using GloVe method. Data contains vectors on Wikipedia data. While embedding data i am getting error stating that could not convert string to float: 'ng' I tried going through data but there i was not able to find symbol 'ng' # load embedding as a dict def load_embedding(filenam...
1
1
0
1
0
0