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 working on a project in which I am trying to calculate the percentage of inflectional morphology of multiple corpora in order to compare them. I know how to use the nltk Porter Stemmer in order to get the root of the word, but it would be much more helpful for me if I could return the affix rather than the root. I...
1
1
0
0
0
0
(Note: I am aware that there have been previous posts on this question (e.g. here or here, but they are rather old and I think there has been quite some progress in NLP in the past few years.) I am trying to determine the tense of a sentence, using natural language processing in Python. Is there an easy-to-use package...
1
1
0
0
0
0
Can AWS SageMaker handle binary classification using TFidf vectorized text as prediction base?
1
1
0
0
0
0
I am trying to save a list of words that I have converted to a dataframe into a table in databricks so that I can view or refer to it later when my cluster restarts. I have tried the below code but it keeps giving me an error or does run but I can't see the table in the database myWords_External=[['this', 'is', 'my', ...
1
1
0
0
0
0
I'm fine tuning a gpt-2 model following this tutorial: https://medium.com/@ngwaifoong92/beginners-guide-to-retrain-gpt-2-117m-to-generate-custom-text-content-8bb5363d8b7f With its associated GitHub repository: https://github.com/nshepperd/gpt-2 I have been able to replicate the examples, my issue is that I'm not findin...
1
1
0
0
0
0
I'm trying to pad a text for a seq2seq model. from keras_preprocessing.sequence import pad_sequences x=[["Hello, I'm Bhaskar", "This is Keras"], ["This is an", "experiment"]] pad_sequences(sequences=x, maxlen=5, dtype='object', padding='pre', value="<PAD>") I encounter following error: ValueError: `dtype` object is n...
1
1
0
0
0
0
I have created a LDA model using Gensim, for which I first iterated from num_topics in range 3 to 10, and based on pyLDAvis plots, chose n = 3 in final lda model. import glob import sys sys.path.append('/Users/tcssig/Documents/NLP_code_base/Doc_Similarity') import normalization from gensim.models.coherencemodel import ...
1
1
0
0
0
0
In the tutorial example of spaCy in Python the results of apples.similarity(oranges) is 0.39289959293092641 instead of 0.7857989796519943 Any reasons for that? Original docs of the tutorial https://spacy.io/docs/ A tutorial with a different answer to the one I get: http://textminingonline.com/getting-started-with-sp...
1
1
0
0
0
0
I have an interesting problem. I have a list of billions of URLs. Something like: www.fortune.com www.newyorktimes.com www.asdf.com I also have an English dictionary as a JSON file. https://github.com/dwyl/english-words. How can I count the number of English words detected in the URL? For example, for the URLS above, ...
1
1
0
0
0
0
I'm new to NLP and am struggling to interpret the results I get when looking at a simple example of NLP classification of most important features. Specifically, in the common example I've shown below, I don't understand why the word "this" is informative when it appears in 3/5 negative sentiment sentences, and 3/5 posi...
1
1
0
0
0
0
A possibly very basic question about NLP best practices. Does punctuation affect the behaviour of NLTK's Parts-of-Speech tagger? Or is it fine to remove punctuation from a sentence before passing it to the POS tagger?
1
1
0
0
0
0
I am working to find nearly duplicates between short text fields. As an example, a text field looks like this: TUBING,SHRINK: 3/8",4' LG,FLEXIBLE POLYOLEFIN,HEAT,2:1 in my case, these special characters and numbers are meaningful and removing them might impact to find the right duplicates. Any suggestion on how to dea...
1
1
0
0
0
0
Can we extract dynamic entities that we not defined in the nlu file or data file? Below is my NLU File intent:benename ahsan ali ahsan mohsin ahmed qaseem yasir qaiser salman daniyal For example: above bene_names are easily extract by nlu engine, but what if when user enter a new name? how we can get that name?
1
1
0
0
0
0
I am applying wordNet lemmatizer into my corpus and I need to define the pos tagger for lemmatizer: stemmer = PorterStemmer() def lemmitize(document): return stemmer.stem(WordNetLemmatizer().lemmatize(document, pos='v')) def preprocess(document): output = [] for token in gensim.utils.simple_preprocess(document...
1
1
0
0
0
0
Sentihood Dataset is a dataset for Target Aspect-based Sentiment Analysis. Its Test and Train file are available in Json format. However, when I try loading it using the json module of python, it gives the following error- JSONDecodeError: Expecting value: line 7 column 1 (char 6) Is there some other way of loading Jso...
1
1
0
0
0
0
I'm working on a project for text similarity using FastText, the basic example I have found to train a model is: from gensim.models import FastText model = FastText(tokens, size=100, window=3, min_count=1, iter=10, sorted_vocab=1) As I understand it, since I'm specifying the vector and ngram size, the model is been ...
1
1
0
0
0
0
I am currently trying to build a LSTM RNN using pytorch. One input vector is represented as an array of 50 integers corresponding to a sequence of at most 50 tokens with padding where each integer corresponds to an element from my vocabulary and the index of the 1 in the OHE vector. I want to have an embedding layer t...
1
1
0
0
0
0
I have a dataset of 8500 rows of text. I want to apply a function pre_process on each of these rows. When I do it serially, it takes about 42 mins on my computer: import pandas as pd import time import re ### constructing a sample dataframe of 10 rows to demonstrate df = pd.DataFrame(columns=['text']) df.text = ["The ...
1
1
0
0
0
0
I am using spacy to create vectors of a sentence. If the sentence is 'I am working', it gives me a vector of shape (3, 300). Is there any way to get back the text in the sentence using those vectors? Thank in advance, Harathi
1
1
0
0
0
0
I am looking for a tokenizer that is expanding contractions. Using nltk to split a phrase into tokens, the contraction is not expanded. nltk.word_tokenize("she's") -> ['she', "'s"] However, when using a dictionary with contraction mappings only, and therefore not taking any information provided by surrounding words in...
1
1
0
0
0
0
In python, I already have a list of words and a list of stem. How to create a dictionary where the key is the stem and the value is a list of words with that stem, like this: {‘achiev’: [‘achieved’, ‘achieve’] ‘accident’: [‘accidentally’, ‘accidental’] … }
1
1
0
0
0
0
I am designing a text processing program and need to stem the words for exploratory analysis later. One of my processes is to stem the words and I have to use Porter Stemmer. I have designed a DataFrame structure to store my data. Furthermore, I have also designed a function to apply to the DataFrame. When I apply the ...
1
1
0
0
0
0
I am working on extraction of positive, negative & neutral keyword in python.There are 10,000 comments in my comments remarks.txt file(encoded UTF-8).I want to import the text file, read the individual row of comments & extract words(tokenize) from the comments mentioned in column c2 & store it in a next adjacent colum...
1
1
0
0
0
0
I am working on an NLP project and I need the following functionality illustrated by an example. Say there is a sentence Tell Sam that he will have to leave without Arthur, as he is sick. In this statement, the first he has to be tagged to Sam and the second he to Arthur. I work in Python. Any suggestions on what I ...
1
1
0
0
0
0
I'm using the following code to click on the 'Show more reviews' button, but not working. Code: link= 'https://www.capterra.com/p/5938/Oracle-Database/' driver.get(link) while True: try: driver.find_element_by_partial_link_text('Show more reviews').click() # Wait till the container of the recipes ge...
1
1
0
0
0
0
I have a data in the following form: author text 0 garyvee A lot of people misunderstand Gary’s message o... 1 jasonfried "I can’t remember having a goal. An actual goa... 2 biz "Tools that can create media that looks and so... I tried the following to clean the text: text_data.loc[:,"text"] =...
1
1
0
0
0
0
I'm trying to test out TensorFlow tf.estimator.DNNClassifier with some simple data X = [[1,2], [1,12], [1,17], [9,33], [48,49], [48,50]] Y = [ 1, 1, 1, 1, 2, 3 ] The classifier takes 2 inputs: x1,x2; and is having this shape: #these 4 layers supposed to be able to do even 4-time linear sep...
1
1
0
1
0
0
I am trying to work on an Arduino bot whose job will be to just recognise voice commands given only by me. I have a Python code for it. But a line is giving me syntax error. That particular line is a print statement which goes like this print len(data), samplerate data, samplerate = sf.read(b) #reading audio file using...
1
1
0
0
0
0
I am a total rookie in computer vision. I am looking to build a model without using pre-trained models for coco dataset or any open-source image datasets. Any articles or references to build such models would be appreciated. I would like to build this model from scratch and make no suggestions on pre-existing trained m...
1
1
0
0
0
0
i have more than 2000 data sets for ANN. I have applied MLPRegressor in it. My code is working fine. But for testing, i want to fix my testing value for instance i have 50 data sets. From that i want to test first 20 value. How do I fix this in the code? I have used the following code. import pandas as pd import matpl...
1
1
0
0
0
0
I am working on a requirement where I have history of previous requests. Requests may be like "Send me a report of .." or "Get me this doc" and this will get assigned to some one and that person will respond. I need to build an app which will analyse the previous request and if a new request arrives and if any of the p...
1
1
0
1
0
0
I am trying to calculate the word embeddings using fasttext for the following sentence. a = 'We are pencil in the hands' I dont have any pretrained model, so how do i go about it?
1
1
0
0
0
0
Trying to run a binary SVM on on the 20_newsgroups dataset. Seem to be getting a ValueError: Found input variables with inconsistent numbers of samples: [783, 1177]. Can anyone suggest why this is happening? from sklearn.datasets import fetch_20newsgroups from nltk.corpus import names from nltk.stem import WordNetLemm...
1
1
0
0
0
0
I have a huge list of text files to tokenize. I have the following code which works for a small dataset. I am having trouble using the same procedure with a huge dataset, however. I am giving the example of a small dataset as below. In [1]: text = [["It works"], ["This is not good"]] In [2]: tokens = [(A.lower().repl...
1
1
0
0
0
0
I have a pandas data frame like below. I want to convert all the text into lowercase. How can I do this in python? Sample of data frame [Nah I don't think he goes to usf, he lives around here though] ...
1
1
0
0
0
0
I have a python dictionary contains list's of values. when I am trying to pos_tag the values inside the list, its showing error. Is there any way to fix it? RuleSet = {1: ['drafts', 'duly', 'signed', 'beneficiary', 'drawn', 'issuing', 'bank', 'quoting', 'lc', ''], 2: ['date', ''], 3: ['signed', 'commerical', 'invoices'...
1
1
0
0
0
0
Suppose I have a string s = SU 3180 and (CMG 3200 or SU 3210). I need to split this string into a tree diagram such as this: X / \ SU 3180 () / - \ CMG 3200 SU 3210 The main goal is to show a difference with and / or split as show in the ...
1
1
0
0
0
0
I am working on a project, it is almost complete, i am working on it's gui. i want to show a transparent image for 5 sec while starting the program in python
1
1
0
0
0
0
So I need to capture substrings in a string that are in between two single apostrophes. For this example I have string: the real question this movie poses is not 'who ? ' but 'why ? ' The output I am currently getting is: [[" 'who ? ' "], [], []] I would like for the regex to capture 'why ? ' as well but I do not k...
1
1
0
0
0
0
After transforming my predicted labels from images into a list all_tags and later splitting them and finally storing into word_list which has all the labels stored in a sentence like structure. All I want to do is use Google's Word2Vec pre-trained model (https://mccormickml.com/2016/04/12/googles-pretrained-word2vec-mo...
1
1
0
1
0
0
I am looking at creating a simple chatbot which can use a pdf file as it's source. For example, the input to the chatbot can be a bank's terms and conditions document and the chatbot would respond to a question which are related to the contents of the document. Sample Q&A. Q : What is my monthly fee for my savings acco...
1
1
0
0
0
0
I am trying to do sentiment analysis on a review dataset. Since I care more about identifying (extracting) negative sentiments in reviews (unlabeled now but I try to manually label a few hundreds or use Alchemy API), if the review is overall neutral or positive but a part has negative sentiment, I'd like my model to co...
1
1
0
1
0
0
I am rather new to both machine learning, NLP, and LDA, so I'm not sure if I'm even approaching my problem entirely correctly; but I am attempting to do unsupervised topic modelling with known topics and multiple topic selections. Based on Topic modelling, but with known topics? I can label every single one of my doc...
1
1
0
1
0
0
I am reading the book "deep learning and the game of go" and I not went far in the book; I wrote the foundations (rules, helper classes) and a Qt GUI interface. All works and I decided to write the examples of minimax program, to see if I can beat it ;-) but it's too slow : it take minutes to play one move, with an ini...
1
1
0
0
0
0
I'm trying to use the FastText Python API https://pypi.python.org/pypi/fasttext Although, from what I've read, this API can't load the newer .bin model files at https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md as suggested in https://github.com/salestock/fastText.py/issues/115 I've tried e...
1
1
0
0
0
0
I'm using spacy with python and its working fine for tagging each word but I was wondering if it was possible to find the most common words in a string. Also is it possible to get the most common nouns, verbs, adverbs and so on? There's a count_by function included but I cant seem to get it to run in any meaningful way...
1
1
0
0
0
0
I'm new at pyspark and I was trying to do some tokenization on my data. I have my first dataframe: reviewID|text|stars I made a tokenization on "text" according to the pyspark documentation: tokenizer = Tokenizer(inputCol="text", outputCol="words") countTokens = udf(lambda words: len(words), IntegerType()) tokenized...
1
1
0
0
0
0
Say I have two columns in my data set, State and Comments. This is basically the comments given by people from different state. I want to analyse the comments column, say I want to see the most used word by a particular state. For eg Comments of people belonging to Texas. I want to create a bar chart or a word cloud fo...
1
1
0
0
0
0
I want to use spaCy's Matcher class on a new language (Hebrew) for which spaCy does not yet have a working model. I found a working tokenizer + POS tagger (from Stanford NLP), yet I would prefer spaCy as its Matcher can help me do some rule-based NER. Can the rule-based Matcher be fed with POS-tagged text instead of th...
1
1
0
0
0
0
Newish to Python and even newer to StackOverflow. Still trying to suss out the best way to ask questions and receive constructive feedback. If I'm doing something wrong or need to provide more info, please let me know. my_words = [] for i in range (0, 26): def predict_more_words(first_word): bimodel = bui...
1
1
0
0
0
0
Using Naive Bayes Alorithm from sklearn.naive_bayes import MultinomialNB nb = MultinomialNB() The code is working till this line but when i fit the model then it shows error. nb.fit(X_train, y_train) Output: ValueError: could not convert string to float: 'My fiance and I tried the place because of a Groupon. We li...
1
1
0
1
0
0
Here is the CSV tableThere are two columns in a CSV table. One is summaries and the other one is texts. Both columns were typeOfList before I combined them together, converted to data frame and saved as a CSV file. BTW, the texts in the table have already been cleaned (removed all marks and converted to lower cases): I...
1
1
0
0
0
0
I'm working on an NLP task and I need to calculate the co-occurrence matrix over documents. The basic formulation is as below: Here I have a matrix with shape (n, length), where each row represents a sentence composed by length words. So there are n sentences with same length in all. Then with a defined context size, e...
1
1
0
1
0
0
For example... Chicken is an animal. Burrito is a food. WordNet allows you to do "is-a"...the hiearchy feature. However, how do I know when to stop travelling up the tree? I want a LEVEL. That is consistent. For example, if presented with a bunch of words, I want wordNet to categorize all of them, but at a certain leve...
1
1
0
0
0
0
I have created a sparse matrix dataframe which has taken the values in a list and set them as column headers. A number of rows contain headers for example "000 bank". I want to remove the "000 " so it is just 'bank' for example. 000 bank 000 claim 000 confirmed 000 debit 000 delete 000 frequent 000 hashed...
1
1
0
0
0
0
I'm trying to modify an example from this post that applies tf-idf. from sklearn.datasets import fetch_20newsgroups from gensim.corpora import Dictionary from gensim.models.tfidfmodel import TfidfModel from gensim.matutils import sparse2full import numpy as np import spacy nlp = spacy.load('en_core_web_md') def ke...
1
1
0
0
0
0
Edit 2: I thought better on my question and realized it was way to generalized and it is only a matter of something basic; creating a new array from the Glove file (glove.6B.300d.txt) that contains ONLY the list of words that I have in my document. I'm aware that this actually has nothing to do with this specific GloVe...
1
1
0
0
0
0
I'm doing a NLP project with my university, collecting data on words in Icelandic that exist both spelled with an i and with a y (they sound the same in Icelandic fyi) where the variants are both actual words but do not mean the same thing. Examples of this would include leyti (an approximation in time) and leiti (a gr...
1
1
0
0
0
0
I wonder how to deploy a doc2vec model in production to create word vectors as input features to a classifier. To be specific, let say, a doc2vec model is trained on a corpus as follows. dataset['tagged_descriptions'] = datasetf.apply(lambda x: doc2vec.TaggedDocument( words=x['text_columns'], tags=[str(x.ID...
1
1
0
0
0
0
I trained a model hand position classifier with Keras and I ended up saving the model with the code (model.save('model.h5') ) now i'm traying to predict an image using this model is it doable? if yes could you give me some examples please ? PS:my data is provided as a CSV file
1
1
0
1
0
0
is there is any way to find the meaning of the string is similar or not,,, even though the words in the string are differentiated Till now i tried fuzzy-wuzzy,levenstein distance,cosine similarity to match the string but all are matches the words not the meaning of the words Str1 = "what are types of negotiation" Str2...
1
1
0
0
0
0
I encountered a coding problem. In my dataset, an instance includes several sentences (different amounts in different instances). They can not be concatenated to serve as a single one. How can I effectively process this kind of data with PyTorch? Or I have to process instance one by one?
1
1
0
0
0
0
I am trying to remove stopwords from a string but the condition I want to achieve is that the named entities in the string should not be removed. import spacy nlp = spacy.load('en_core_web_sm') text = "The Bank of Australia has an agreement according to the Letter Of Offer which states that the deduction should be made...
1
1
0
0
0
0
I'm looking for an answer like this but in python. How can I do text preprocessing on multiple columns? I have two text columns see screenshots. To do the cleaning work, I have to do twice to each column (see my code). Is there any clever way to do a similar task? Thanks! import requests from bs4 import BeautifulSoup ...
1
1
0
0
0
0
Imagine I have a fasttext model that had been trained thanks to the Wikipedia articles (like explained on the official website). Would it be possible to train it again with another corpus (scientific documents) that could add new / more pertinent links between words? especially for the scientific ones ? To summarize, I...
1
1
0
0
0
0
I am working on a NLP project and I have two formats of input texts. Format 1: Some line Some line Name is <name> random text and numbers. age is <age> random text and numbers Some line Format 2: Some line Name <name>. Random text and numbers Some random line Age <age>. random text and numbers What I want to do is...
1
1
0
0
0
0
According to this link, target_vocab_size: int, approximate size of the vocabulary to create. The statement is pretty ambiguous for me. As far as I can understand, the encoder will map each vocabulary to a unique ID. What will happen if the corpus has vocab_size larger than the target_vocab_size?
1
1
0
0
0
0
Given a list of predefined terms that can be formed by one, two or even three words, the problem is to count their ocurrences in a set of documents with a free vocabulary (ie, much many words). terms= [ [t1], [t2, t3], [t4, t5, t6], [t7],...] and the documents where this terms needs to be recognized are in the form o...
1
1
0
0
0
0
I want to store the result in a data-frame in form of a tuple with (predictions, probabilities) in each tags. I can print fine the result at the line: print(eachPrediction , " : " , eachProbability) I'm getting the error for the line : Error message: temprow[i+1] = (predictions[i],probabilities[i]) Inde...
1
1
0
1
0
0
I have got a list of about 300 image_id and bounding box position in a csv file. I also have a folder of about 300 images with each image id matching the name of each image. How do I compare the name of the image and the image_id if it matches me, I will crop it. I use the python language and ubuntu os.
1
1
0
0
0
0
I am working on a project to analyse the previous requests and if a new request comes, I need to match the earlier request and use the solution provided for the same. For Example: if these are previous requests "Risk rating for Microsoft Inc", "Report for the month of September", etc and if new request is "Report for t...
1
1
0
0
0
0
I am working on this dataset [https://archive.ics.uci.edu/ml/datasets/Reuter_50_50] and trying to analyze text features. I read the files and store it as follows in the documents variable: documents=author_labels(raw_data_dir) documents.to_csv(documents_filename,index_label="document_id") documents=pd.read_csv(document...
1
1
0
0
0
0
I have a text file with 30,000 sentences. How can I pad each sentence of this file with start and end symbols such as (s) and (/s) by Python? A part of data is the following: The jury further said in term-end presentments that the City Executive Committee , which had over-all charge of the election , `` deserves the pr...
1
1
0
1
0
0
When I calculate Binary Crossentropy by hand I apply sigmoid to get probabilities, then use Cross-Entropy formula and mean the result: logits = tf.constant([-1, -1, 0, 1, 2.]) labels = tf.constant([0, 0, 1, 1, 1.]) probs = tf.nn.sigmoid(logits) loss = labels * (-tf.math.log(probs)) + (1 - labels) * (-tf.math.log(1 - p...
1
1
0
0
0
0
I have a BERT multilanguage model from Google. And I have a lot of text data in my language (Korean). I want BERT to make better vectors for texts in this language. So I want to additionally train BERT on that text corpus I have. Like if I would have w2v model trained on some data and would want to continue training it...
1
1
0
0
0
0
I have a function to get tfidf feature like this: def get_tfidf_features(data, tfidf_vectorizer=None, ngram_range=(1,2)): """ Creates tfidf features and returns them as sparse matrix. If no tfidf_vectorizer is given, the function will train one.""" if tfidf_vectorizer is not None: tfidf = tfidf_ve...
1
1
0
0
0
0
this might be a little naive question but bear with me. I have a dataset like this. Pretty O bad O storm O here O last O evening O . O From O Green O Newsfeed O : O AHFA B-group extends O deadline O for O Sage O Award O to O Nov O . O where O is tag for non entity, similarly B-group is tag fo...
1
1
0
0
0
0
Currently i am working on a project using nlp and python. i have content and need to find the language. I am using spacy to detect the language. The libraries are providing only language as English language. i need to find whether it is British or American English? Any suggestions? I tried with Spacy, NLTK, lang-detect...
1
1
0
0
0
0
I have a dataset like this. The 1st column is the word and 2nd column is the tag. Pretty O bad O storm O here O last O evening O . O From O Green O Newsfeed O : O AHFA B-group extends O deadline O for O Sage O Award O to O Nov O . O I want to reconstruct the sentences, so the output will be ...
1
1
0
0
0
0
I'm working in a code for extract wrong words in a text, I'm using python with "textblob" library. In this library there is a function correction(), but it just returns the correct phrase based on the wrong phrase, for example: in: b = TextBlob("I havv goood speling!") in: print(b.correct()) out: I have good spelling!...
1
1
0
0
0
0
Datasets: I have two different text datasets(large text files for train and test that each one includes 30,000 sentences). a part of data is like the following: " the fulton county grand jury said friday an investigation of atlanta's recent primary election produced `` no evidence '' that any irregularities took place ...
1
1
0
1
0
0
I'm building a Word2Vec model for a category-recommendation on a dataset consisting of ~35.000 sentences for a total of ~500.000 words but only ~3.000 distinct ones. I build the model basically like this : def train_w2v_model(df, epochs): w2v_model = Word2Vec(min_count=5, window=100...
1
1
0
1
0
0
Datasets: Two Large text files for train and test that all words of them are tokenized. a part of data is like the following: " the fulton county grand jury said friday an investigation of atlanta's recent primary election produced `` no evidence '' that any irregularities took place . " Question: How can I replace eve...
1
1
0
1
0
0
I am using spacy library to build a chat bot. How do I check if a document is a question with a certain confidence? I know how to do relevance, but not sure how to filter statements from questions. I am looking for something like below: spacy.load('en_core_web_lg')('Is this a question?').is_question
1
1
0
0
0
0
I've tried to implement a Best First Search Algorithm on 8 puzzle problem.But I get the same path as in A* code no matter whatever matrix I take. Also, can someone help me to print the heuristics under each matrix? I only get "1" in the output. Best First Search Code- from copy import deepcopy from collections import d...
1
1
0
0
0
0
I would be interested to extract the weights, biases, number of nodes and number of hidden layers from an MLP/neural network built in pytorch. I wonder if anyone may be able to point me in the right direction? Many thanks, Max
1
1
0
1
0
0
I want to use the concept of spam classification and apply it to a business problem where we identify if a vision statement for a company is good or not. Here's a rough outline of what I've come up with for the project. Does this seem feasible? Prepare dataset by collecting vision statements from top leading companies...
1
1
0
0
0
0
I have done a lot of research on how to create chat bots (the responding part) however I can't find a way to make it more advanced. For example, I keep seeing NLTK reflections but I want to know if there are more advanced methods in NLTK (or other modules) that allow me to create a learning bot, smart bot or even an AI...
1
1
0
0
0
0
In my studies on NLP, more specifically the spacy library, I was confused with that, what is the difference between from spacy.lang.en import English() and spacy.load('en') and how it works? Someone can help me explain this and if possible with some example of this difference? Thanks in advance.
1
1
0
0
0
0
I want to compare the two sentences. As a example, sentence1="football is good,cricket is bad" sentence2="cricket is good,football is bad" Generally these senteces have no relationship that means they are different meaning. But when I compare with python nltk tools it will give 100% similarity. How can I fix this Issue...
1
1
0
0
0
0
I'm writing a program to analyze the usage of color in text. I want to search for color words such as "apricot" or "orange". For example, an author might write "the apricot sundress billowed in the wind." However, I want to only count the apricots/oranges that actually describe color, not something like "I ate an apri...
1
1
0
0
0
0
I am writing a program to detect collocations of bigrams (2 words that appear together more often than by chance, ex: hot dog). To do this properly, I have to remove all punctuation marks that would be stored as their own element but keep punctuations that are part of a word. For example, the bigram ['U.S. flag'] shoul...
1
1
0
0
0
0
I am trying to use Spacy's Japanese tokenizer. import spacy Question= 'すぺいんへ いきました。' nlp(Question.decode('utf8')) I am getting the below error, TypeError: Expected unicode, got spacy.tokens.token.Token Any ideas on how to fix this? Thanks!
1
1
0
0
0
0
I have a MCQ dataset which has 2 input variables question and answer, and output variable distractor ( string of 3 independent sub strings separated by comma). The aim is build a NLP model that generates 3 distractors for each question and answer, that is separated by comma and must be place between double quotes " "....
1
1
0
1
0
0
I need to print only 'NN' and 'VB' words from an entered sentence. import nltk import re import time var = raw_input("Please enter something: ") exampleArray = [var] def processLanguage(): try: for item in exampleArray: tokenized = nltk.word_tokenize(item) tagged = nltk.pos_tag(...
1
1
0
0
0
0
enter image description here This is my code : config = Config(mode='conv') if config.mode == 'conv': X, y = build_rand_feat() y_flat = np.argmax(y, axis=1) model=get_conv_model() elif config.mode == 'time': X, y = build_rand_feat() y_flat = np.argmax(y,axis=1) ...
1
1
0
0
0
0
I want to apply the svm using the following approach but apparently the "Bunch" type is not appropriate. Usually, with Bunch (Dictionary-like object), the interesting attributes are: ‘data’, the data to learn and ‘target’, the classification labels. You can access the .data and the .target information accordingly. How...
1
1
0
0
0
0
I have a data set. One of its columns - "Keyword" - contains categorical data. The machine learning algorithm that I am trying to use takes only numeric data. I want to convert "Keyword" column into numeric values - How can I do that? Using NLP? Bag of words? I tried the following but I got ValueError: Expected 2D arra...
1
1
0
1
0
0
I want to train a word2vec model on the english wikipedia using python with gensim. I closely followed https://groups.google.com/forum/#!topic/gensim/MJWrDw_IvXw for that. It works for me but what I don't like about the resulting word2vec model is that named entities are split which makes the model unusable for my spec...
1
1
0
0
0
0
I have a list of word pairs in Icelandic that are spelled similarly but mean different things (for example leyti and leiti, kyrkja and kirkja). The list is just a single element list, not a list of tuples (so just [leyti, leiti, kyrkja, kirkja]). I'm using a big corpus to get each word's frequency, so I could end up wi...
1
1
0
0
0
0