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
Is there a way to create a CSV file with training phrases in it and convert the same to nlu.md format that is acceptable by Rasa. This needs to be done for various intents with various training phrases.
1
1
0
0
0
0
I know how to load images from local machine for training in tensorflow. I want a way to load images for testing purpose specially when I have used tensorflow.keras.preprocessing.image.ImageDataGenerator for training.
1
1
0
0
0
0
I have created a Spacy Phrasematcher to match names in a document, following the tutorial. I want to use the resulting matches as additional training data in order to train a Spacy NER model. My patterns, however, contain both full names (e.g. 'Barack Obama') and last names ('Obama') separately. Hence, in a sentence th...
1
1
0
0
0
0
I am fairly new to spacy / textacy and I have a complicated task ahead. Your help is much appreciated. In a nutshell, from a sentence like "Did assault paramedic by kicking and pushing him", I want to establish whether the reported abuse was against a police officer or other worker (ambulance, hospital staff, traffic w...
1
1
0
0
0
0
I am using pytorch and the dataset fashion MNIST but I do not know how can I do to evaluate the mean and the std for this dataset. Here is my code : import torch from torchvision import datasets, transforms import torch.nn.functional as F transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((...
1
1
0
0
0
0
I am using Anaconda. First I installed StanfordNLP and when I execute the command stanfordnlp.download('en') it gives following error; (base) C:\Users\Abdullah>python Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" fo...
1
1
0
0
0
0
I'm currently working on replacing a system based on nltk entity extraction combined with regexp matching where I have several named entity dictionaries. The dictionary entities are both of common type (PERSON (employees) etc.) as well as custom types (e.g. SKILL). I want to use the pre-trained spaCy model and include ...
1
1
0
0
0
0
I came across a situation where i have to get the pos_ & tag_ from spacy doc objects. For example, text = "Australian striker John hits century" doc = nlp(text) for nc in doc.noun_chunks: print(nc) #Australian striker John doc[1].tag_ # gives for striker if I want to get pos_ & tag_ for word 'striker' do I need ...
1
1
0
0
0
0
Picture of raw excel file format Attached picture reference for how my raw excel data looks like. Loaded into pandas dataframe. Each message is spread across multiple columns with occasional blank cells in between each column. Also, the separator for each message is 2 consecutive empty rows. To combine the message, I ...
1
1
0
0
0
0
I am new to NLP and now I want to parse a lot of sentences(about 10000) to get their CFG trees. Before that I have to build a grammar to parse them. I try to use NLTK treebank, but they can not be load as grammar. I do not know why, could anyone please give me some advice? import nltk from nltk.corpus import treebank n...
1
1
0
0
0
0
I want to calculate the sentence meaning similarity. I am using cosine similarity but this method does not fulfill my needs. For example, if I have these two sentences. He and his father are very close. He shares a wonderful bond with his father. What I need is calculating the similarity between these sentences based...
1
1
0
1
0
0
I have a function to remove url links from a series, but it doesn't appear to work. The error when I pass the series through the function is: 'str' object has no attribute 're' def remove_url(list_of_tokens): ''' Remove url ''' cleaned_tokens = [] for token in list_of_tokens: token = to...
1
1
0
0
0
0
I have been trying to parse some very old data to structure and store them in a database. I have some random strings that contain dates. YEAR:1999 DATE:09/1999 DATE:09/1996 DATE:1993 YEAR:2006 DATE:15/05/06 YEAR:2019 DATE:JANUARY 3, 2019 YEAR:2019 DATE:FEB. 14, 2019 YEAR:2019 DATE: 30/06/2019, JUNE 24, 2019 as...
1
1
0
0
0
0
I have two files file1.csv and file2.csv. file1.csv contains a stupid sentence in each row. file2.csv identify which column it is (type0 corresponding to 0, type1 corresponding to 1). I want to do a NLP classification task and I know usually how to do it. But in this situation I am bit confused and do not know how to a...
1
1
0
0
0
0
I trained a custom model by this (https://spacy.io/usage/training/#example-new-entity-type) method specified in the spacy website. While loading the traine model , i got the error : File "tokenizer.pyx", line 450, in spacy.tokenizer.Tokenizer.from_disk File "tokenizer.pyx", line 498, in spacy.tokenizer.Tokenizer.fr...
1
1
0
0
0
0
Newbie in Python and Deep Learning here! I have 10,000 XML files that contain information about patent documents (obtained from WIPO). I want to extract the titles, abstracts and classifications of each document. I have managed to do so using ElementTree and saved them in 3 lists, but I realized that there is one docum...
1
1
0
0
0
0
I tied to follow a book on deep learning, where there is an chapter about generating text in the style of an example. They used an char level RNN with two LSTM layers in it to generate text in the style of shakespare. But the code in the book (also online: https://github.com/DOsinga/deep_learning_cookbook/blob/master/0...
1
1
0
0
0
0
I have a dataframe of ids and text, and would like to get n-gram counts per id (e.g. an id-term matrix). As an example, let's i want bi-grams (2-grams) for the following table +-----+------------------+ | id | text | +-----+------------------+ | id1 | quick with fox | | id1 | brown fox | | id1 | ...
1
1
0
0
0
0
Hello I am trying to evaluate the standard deviation and the mean of the dataset MNIST and I get a wrong value for the standard deviation. Here is my code : import torch from torchvision import datasets, transforms import torch.nn.functional as F loader = torch.utils.data.DataLoader(datasets.MNIST( '../data', train=Tr...
1
1
0
0
0
0
I am experimenting with the gpt-2 model's conditional text generation to tweak it for a good chatbot. I am using nsheppard's code for retraining it on my custom dataset. I trained my model on a custom dataset of conversations that I pulled from my facebook data. I changed the sample length to 20 as they are dialogues d...
1
1
0
0
0
0
I have been trying to infer a timeliness score (a score based on patients' waiting times) from patients' reviews in hospitals. The data available is patients' reviews and their ratings of the overall experience. The problem is I don't have labels for the timeliness scores of the patients but a rating of the whole exper...
1
1
0
1
0
0
I have to apply some multiple functions to a column to get the list of bigrams but it is painfully slow using the apply function the way I'm currently using. Do you have a way to boost the speed? def remove_stop_words(text): cleantext = text.lower() cleantext = ' '.join(re.sub(r'[^\w]', ' ', cleantext).strip()....
1
1
0
0
0
0
I've been searching for an answer to this specific question for a few hours and while I've learned a lot, I still haven't figured it out. I have a dataset of ~70,000 sentences with subset of about 4,000 sentences that have been appropriately categorized, the rest are uncategorized. Currently I'm using a scikit pipelin...
1
1
0
0
0
0
I am using spacy in google colab to build an NER model for which I have downloaded the spaCy 'en_core_web_lg' model using import spacy.cli spacy.cli.download("en_core_web_lg") and I get a message saying ✔ Download and installation successful You can now load the model via spacy.load('en_core_web_lg') However then whe...
1
1
0
0
0
0
I need to classify/categorize the various sentences in the job_experience section of n=630 job descriptions. I'm particularly interested in extracting the work experience and ability-related sentences, but I need to be able keep them attached to the job_title that they are associated with. Current state of these job d...
1
1
0
0
0
0
My corpus is a series of documents with twitter data, and has been cleaned and pre-processed to be best of my knowledge (even including emoji)- example below: 0 [national, interest, think, worth, holding, ta... 1 [must, accurate, diane, abbott, done, calculat... I then instantiate TFIDF: # ...
1
1
0
0
0
0
Is there a way to get specific text from pdf using NLP or python library
1
1
0
0
0
0
I run my script with defining ngram_vectorizer = CountVectorizer(binary=True) and ngram_vectorizer = CountVectorizer(binary=False) The result of the confusion matrix is different for both. Could help me understand what binary do ?
1
1
0
0
0
0
I want to use fasttext pre-trained models to compute similarity a sentence between a set of sentences. can anyone help me? what is the best approach? I computed the similarity between sentences by train a tfidf model. write code like this. is it possible to change it and use fasttext pre-trained models? for example use...
1
1
0
0
0
0
I am working on face recognition project , in which I train the model. prediction I load images and want to calculate distanse betwwen 2 images. while predection i am getting below error: TypeError Traceback (most recent call last) <ipython-input-21-0b1f36824e17> in ...
1
1
0
0
0
0
this my code you can see i am tokonize the sentence to word but i am still have a problem when i apply word2vec model in my sentences i use Arabic text anaconda version 4.7.12 sentences = nltk.sent_tokenize(str(sentences1)) sentences = [nltk.word_tokenize(sentence) for sentence in sentences] for i in range(len(senten...
1
1
0
0
0
0
I've just trained an LSTM language model using pytorch. The main body of the class is this: class LM(nn.Module): def __init__(self, n_vocab, seq_size, embedding_size, lstm_size, pretrained_embed): super(LM, se...
1
1
0
0
0
0
i'm trying to build a neural network using pytorch-nlp (https://pytorchnlp.readthedocs.io/en/latest/). My intent is to build a network like this: Embedding layer (uses pytorch standard layer and from_pretrained method) Encoder with LSTM (also uses standard nn.LSTM) Attention mechanism (uses torchnlp.nn.Attention) Deco...
1
1
0
0
0
0
Let's say we have a sentence in python3 with a blank space like the following: sentence = "Tomorrow I want to go _______." and we want to find out which word is more likely to appear in the blank space from a pool of words: pool_of_words = ['eating', 'playing', 'thinking', 'jogging'] Question: How can I estimate the pr...
1
1
0
0
0
0
my project is to classify the reviews as good or bad using nlp. i have imported the data and done the tokenisation, vectorisation using bag of words model. now i have to spilt the data into testing and training sets and i am getting an error saying "Found input variables with inconsistent numbers of samples: [1000, 234...
1
1
0
0
0
0
I'm doing the Datacamp course on NLP in Python. One of the exercises asks the following: Use re.search() to search for the first occurrence of the word "coconuts" in scene_one. Store the result in match. Print the start and end indexes of match using its .start() and .end() methods, respectively. I'm doing this: match...
1
1
0
0
0
0
I've been trying to apply TFIDF vectorizer on a gensim LDA model with no success. It looks like I have to use any() or all() but I'm not sure what is going on with the vectorizer. The data has been cleaned and pre-processed. Data: text_data= 0 [new, leaked, treasury, document, full, sugges... 1 [tommy, ...
1
1
0
0
0
0
I'm trying to extract some particular information from the image(png). I tried to extract the text using the below code import cv2 import pytesseract import os from PIL import Image import sys def get_string(img_path): # Read image with opencv img = cv2.imread(img_path) # Convert to gray img = cv2.cvt...
1
1
0
0
0
0
I am trying to work on an AI that composes possible winning bets. However I don't know how I should approach this way of AI. I've made simple AI's that can detect the differenace between humans and animals for example, but this one is a lot more complex. Which AI model should I use? I don't think linear regression and ...
1
1
0
0
0
0
I'm new to Python, and have been looking at text cleaning examples such as this on Kaggle, and had a few questions on the stemming and stopwords part. for sentence in final_X: sentence = sentence.lower() # Converting to lowercase cleanr = re.compile('<.*?>') sentence = re.sub(cleanr, ' ', sentenc...
1
1
0
0
0
0
I'm preprocessing some text for a NER model I'm training, and I'm encountering this character quite a lot. This character is not removed with strip(): >>> 'Hello world!\u200b'.strip() 'Hello world!\u200b' It is not considered a whitespace for regular expressions: >>> re.sub('\s+', ' ', "hello\u200bworld!") 'hello\u200...
1
1
0
0
0
0
I'm trying to find the quadgram English words I tried to change alpino which downloads the dutch words to en or English but its not working any idea ? from nltk.util import ngrams from nltk.corpus import alpino print(alpino.words()) quadgrams=ngrams(alpino.words(),4) for i in quadgrams: print(i)
1
1
0
0
0
0
I am trying to install rasa on Windows 10. I have installed Python 3.6 & pip. When I am running pip install rasa_nlu I am getting the following error: c:\program files (x86)\python36-32\include\pyconfig.h(222): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory error: command 'C:\\Prog...
1
1
0
0
0
0
I have a csv. contains 'gender','diagnosis','test','physical_exam','medicine' these columns. I want to predict 'medicine' column on the base of 'gender','diagnosis','test','physical_exam' these columns. I have done this: import nltk import re import pandas as pd from io import StringIO import numpy as np from nltk.toke...
1
1
0
1
0
0
I am using opencv in Python and trying to record/save only those frames from video when a particular type of object/label is present in the frame for example 'umbrella' Issues: It correctly start saving frames from the instance where it first find that mentioned object/label in a frame but if that object/label is not t...
1
1
0
0
0
0
I have a script that replaces a word with a synonym using NLTK and WordNet. As far as I can tell, the most effective way to find a synonym by lemmatizing, but that removes conjugation from the process. For example, say I want to replace "bored" with "drilled"... word = 'bored' syns = [] wordNetSynset = wn.synsets(word...
1
1
0
0
0
0
I'd like some help choosing an NLP strategy for categorizing journal entries. Here's an example of what a journal entry might look like and what a correct categorization would be. "Yesterday, I got terrible sleep. I felt pretty tired, so my productivity for the day wasn't very good." Categorization: "Sleep: terrible" ...
1
1
0
1
0
0
I am newly getting into NLP, Python, and posting on Stackoverflow at the same time, so please be patient with me if I might seem ignorant :). I am using SnowballStemmer in Python's NLTK in order to stem words for textual analysis. While lemmatization seems to understem my tokens, the snowball porter2 stemmer, which I ...
1
1
0
0
0
0
I am working on the project with the group and we have decided to make the project on the ' Automatic Attendance System by AI ' I have learned the CNNs to categorize the objects i.e dogs and cats. With that knowledge, we have decided to make the attendance system based on CNN. ( Please tell me if we shouldn't take this...
1
1
0
0
0
0
I am currently working with the spacy-pytorch-transformer package to experiment with the respective embeddings. When reading the introductionary article (essentially the GitHub README), my understanding was that the token-level embeddings are the mean over the embeddings of all corresponding word pieces, i.e. embed(com...
1
1
0
0
0
0
Sorry if it's a simple question, I'm new in python. I have an string (array of words) and a 2 dimensions of words which I'm going to replace them one by one as something like follow: str="Jim is a good person" # and will convert to: parts=['Jim','is','a','good','person'] and a 2 dimensions array which each dimension i...
1
1
0
0
0
0
I'm trying to execute simple code to lemmatize string, but there's an error about iteration. I have found some solutions which are about reinstalling web.py, but this not worked for me. python code from gensim.utils import lemmatize lemmatize("gone") error is -----------------------------------------------------------...
1
1
0
0
0
0
I'm new to NLP. Working on this from last 2/3 days. Using spacy for this. I'm trying to "train an additional entity type" by using the following piece of code... """Example of training an additional entity type This script shows how to add a new entity type to an existing pre-trained NER model. To keep the example sho...
1
1
0
0
0
0
The error message is this Traceback (most recent call last): File "./run_classifier.py", line 914, in <module> tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/usr/local...
1
1
0
0
0
0
I'm struggling with the concept of derivatives in calculus. I've tried watching videos and reading textbooks, but I'm still not grasping it. Can you guide me to some better resources or explain it in a different way?
0
0
1
0
1
0
I'm struggling with the concept of limits in calculus. Despite understanding the definition and the intuitive idea behind it, I'm having trouble applying it to solve problems. Can you guide me through some examples?
0
0
1
0
1
0
I'm struggling with understanding the concept of word embeddings in the context of neural networks for NLP. Can you guide me through how they're created and used?
0
1
1
0
0
0
I'm having trouble with named entity recognition in my custom NLP model. It's not correctly identifying people's names. Any suggestions?
0
1
1
0
0
0
I'm struggling to understand how Python's garbage collection works. I've read the docs but I still can't grasp it. Can you help?
1
0
1
0
0
0
I'm struggling with understanding the proof of the Fundamental Theorem of Calculus. I've read the textbook but it's still not clicking. Could you help explain it in a different way?
0
0
1
0
1
0
I'm struggling to understand the concept of derivative in calculus and how it's applied in physics. I've read the textbook and watched tutorials, but I'm still having trouble grasping it. Could you provide some additional resources or explain it in a different way?
0
0
1
0
1
0
I'm struggling to understand the concept of tokenization in NLP. I've read about it, but I can't seem to grasp how it differs from text segmentation. Can you provide some insight or point me to some resources?
0
1
1
0
0
0
I'm struggling with the concept of sequence-to-sequence models in transformers for machine translation. Could you provide some resources or guide me on how to implement them?
0
1
1
0
0
0
I've trained a neural network using Keras, but it's not performing as expected. I suspect there might be a problem with my data preprocessing steps. Could you guide me through debugging this issue?
0
0
1
1
0
0
I'm struggling to understand the difference between supervised and unsupervised learning. Can you walk me through the key differences?
0
0
1
1
0
0
I'm struggling with the proof by induction for the sum of first n natural numbers. The base case and inductive step are clear, but I'm having trouble putting it all together.
0
0
1
0
1
0
I'm struggling with the concept of limits in calculus. I understand the basic idea but I'm not sure how to apply it to complex problems. Can you help?
0
0
1
0
1
0
I've been trying to integrate a transformer model for sentiment analysis, but I'm getting an error with the attention mechanism. Any suggestions on how to troubleshoot this?
0
1
1
0
0
0
I'm struggling with the concept of 'catastrophic forgetting' in my deep learning model. It seems to perform poorly on old tasks after learning new ones. How can I mitigate this issue?
0
1
1
0
0
0
I'm having trouble with the sentiment analysis model. It keeps predicting 'positive' for neutral or negative tweets. Any suggestions on how to fine-tune it?
0
1
1
0
0
0
I'm trying to use the 'tokenize' function in spaCy but it's not returning the expected output. I've tried different languages and it seems to work fine for English, but not for languages with complex script systems like Arabic or Hebrew. Any suggestions on how to handle this?
0
1
1
0
0
0
I'm struggling with the concept of derivatives in calculus. I've tried watching videos and reading textbooks, but I'm still not grasping it. Can you guide me to some better resources or explain it in a different way?
0
0
1
0
1
0
I'm having trouble understanding the proof of the Riemann hypothesis in the context of prime number distribution. Can you help me grasp the underlying mathematical concepts?
0
0
1
0
1
0
I'm struggling to understand the concept of word embeddings in the context of neural networks. Could you provide some resources or explain it in a different way?
0
1
1
0
0
0
I'm struggling with the concept of embeddings in transformer models. Could you provide some resources or explain it in simpler terms?
0
1
1
0
0
0
I'm struggling to understand how Python's garbage collection works. I've read the docs but I still can't wrap my head around it. Can you provide a simple explanation or some resources to learn more?
1
0
1
0
0
0
I'm struggling to understand the difference between list comprehensions and generator expressions in Python. Can someone provide a clear explanation with examples?
1
0
1
0
0
0
I'm struggling with understanding the proof of the Pythagorean theorem. I've read the steps, but I'm having trouble following the logic behind it. Can you guide me through it?
0
0
1
0
1
0
I'm struggling with the concept of limits in calculus. The definition seems clear, but I'm having trouble understanding how it applies to practical problems. Can you guide me through an example?
0
0
1
0
1
0
I'm struggling to understand the concept of tokenization in the context of NLP. Can you help?
0
1
1
0
0
0
I'm struggling with the concept of word embeddings in NLP. Can you guide me through how they're created and how they capture semantic similarity?
0
1
1
0
0
0
I'm having trouble with my deep learning model. It's overfitting on the training data and I've tried various techniques to regularize it, but it's not improving. Any suggestions?
0
0
1
1
0
0
I'm having trouble with my neural network not converging. I've tried adjusting learning rates and batch sizes, but nothing seems to be working. Also, I'm not sure if my data is properly preprocessed.
0
0
1
1
0
0
I'm struggling with the concept of 'tangential acceleration' in kinematics. Could someone provide a clear explanation or a relevant worked example?
0
0
1
0
1
0
I'm struggling with the application of derivatives in my calculus class. Can you guide me through the process of finding the equation of a tangent line at a specific point on a curve?
0
0
1
0
1
0
I'm struggling to understand the concept of reinforcement learning and how it differs from supervised learning. Can you provide some clear examples?
0
1
1
0
0
0
I'm struggling to implement the transformers library for a sentiment analysis task. The documentation is unclear about how to modify the pre-trained BERT model for my specific use case.
0
1
1
0
0
0
I'm having trouble understanding the concept of tokenization. The documents I've been reading are contradictory and I'm at a loss. Can you help me grasp this better?
0
1
1
0
0
0
I'm having trouble understanding the concept of word embeddings in neural networks. The tutorials I've found online are too simplistic or lack clear explanations. Can you recommend any resources or provide a step-by-step guide?
0
1
1
0
0
0
I'm struggling with the concept of limits in calculus. I understand L'Hôpital's rule, but I'm having trouble applying it to more complex functions. Can you guide me through a step-by-step process?
0
0
1
0
1
0
I'm struggling with the concept of limits in calculus. Despite understanding the definition, I'm having difficulty applying it to solve problems. Can you help me understand limits?
0
0
1
0
0
0
I'm struggling to understand the concept of tokenization in NLTK. When I try to tokenize a sentence, it's not giving me the expected output. Can you help?
0
1
1
0
0
0
I'm having trouble with named entity recognition in my custom NLP model. It's misclassifying 'Steve Jobs' as a location. Any tips on how to improve this?
0
1
1
0
0
0
I'm struggling to understand how Python's garbage collection works. I've read the docs but I still can't wrap my head around it. Can you explain it like I'm five?
1
0
1
0
0
0
I'm struggling to understand the difference between Python's list and tuple. Can you provide an example where each is used in a meaningful way?
1
0
1
0
0
0
I'm struggling with the concept of limits in calculus. I understand what they are theoretically, but I'm having trouble applying them in practice. Can you help?
0
0
1
0
1
0
I'm having trouble understanding the concept of limits in calculus. The examples in my textbook aren't clicking, and I could use some real-world analogies to grasp it better. The problem set is due tomorrow.
0
0
1
0
1
0
I'm struggling to understand the concept of tokenization in NLP. I've read about it, but I'm not sure I'm doing it right. Could you guide me through it with an example, please?
0
1
1
0
0
0
The recursion theorem in NLP, when applied to context-free grammars, allows us to prove that any string can be generated by a grammar, given that the start symbol is reachable. However, this doesn't imply that all strings are linguistically meaningful. Discuss.
0
1
1
0
0
0
I'm struggling to understand the differences between supervised and unsupervised learning. Could you provide an intuition-based explanation? I've tried looking it up, but I'm still confused.
0
0
1
1
0
0