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 tried various means to correctly tag a bunch of words which form a phrase (especially Noun Phrase) but could not succeed.
Example: 'the', 'first', 'early','morning', 'sunbeams'
'early' and 'morning' are wrongly being tagged as 'Noun' where expected outcome should be: ('first', 'adverb'), ('early', 'adverb'), ('mornin... | 1 | 1 | 0 | 0 | 0 | 0 |
I have seen this same topic some other place but no real answer to my question. I have a numpy array and I need to find the index of a number.
a=np.argsort(cosine_similarity(tfidf_matrix[11:12], tfidf_matrix)) #numbers are from 0 to 11
b=np.equal(a,10)
# b values are [[False False False False False False False False ... | 1 | 1 | 0 | 1 | 0 | 0 |
Novice alert
I have been learning ML in python for the last few months and have had some great results. Currently, however, I am stuck with a project and require the guidance of someone with more experience (Google can only take you so far it appears ).
What I am trying to achieve
I have a dummy data set full of clien... | 1 | 1 | 0 | 1 | 0 | 0 |
I am trying to use an SVD model for word embedding on the Brown corpus. For this, I want to first generate a word-word co-occurence matrix and then convert to PPMI matrix for the SVD matrix multiplication process.
I have tried to create a co-occurence using SkLearn CountVectorizer
count_model = CountVectorizer(ngram_r... | 1 | 1 | 0 | 0 | 0 | 0 |
I used gimsm for LSA as per this tutorial
https://www.datacamp.com/community/tutorials/discovering-hidden-topics-python
and I got the following output after running it for a list of text
[(1, '-0.708*"London" + 0.296*"like" + 0.294*"go" + 0.287*"dislike" + 0.268*"great" + 0.200*"romantic" + 0.174*"stress" + 0.099*"lov... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to search a given text for a specified wordlist. The code is pretty straightforward.
# put the words you want to match into a list
word_list = ["eat", "car", "house", "pick up", "child"]
# get input text from the user
user_prompt = input("Please enter some text: ")
# loop over each word in word_list and ... | 1 | 1 | 0 | 0 | 0 | 0 |
I have a text file where I need to extract first five lines ones a specified keyword occurs in the paragraph.
I am able to find keywords but not able to write next five lines from that keyword.
mylines = []
with open ('D:\\Tasks\\Task_20\\txt\\CV (4).txt', 'rt') as myfile:
for line... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to create a text classifier to determine whether an abstract indicates an access to care research project. I am importing from a dataset that has two fields: Abstract and Accessclass. Abstract is a 500 word description about the project and Accessclass is 0 for not access-related and 1 for access-related. ... | 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to do sentiment analysis on comments; the data set contains two main colums: the first one is "review" which has the reviews of the users, and the second colum is whether it is positive or negative; I got a template from a source to prepocessing the data, the training and testing is okay. However, I want to... | 1 | 1 | 0 | 1 | 0 | 0 |
There are some methods that can retrieve similarity between texts such as wup_similarity() cosine_similarity() etc. My purpose is to make an essay answering system.That means I want to compare the answer sheet and marking scheme. So far I did followings without using any training or modeling approch.
1.pre-processed bo... | 1 | 1 | 0 | 0 | 0 | 0 |
I have a paragraph with some spaces and special characters and "....." 's.
I would like to know if there is any function in python which helps in splitting the lines in the paragraph with specified delimiters like "...."
Thanks in advance
| 1 | 1 | 0 | 0 | 0 | 0 |
I would like to correct the misspelled words of a text in french, it seems that spacy is the most accurate and faster package to do it, but it's to complex,
I tried with textblob, but I didn't manage to do it with french words.
It works perfectly in english, but when I try to do the same in french I get the same misspe... | 1 | 1 | 0 | 0 | 0 | 0 |
As described, I load a trained word2vec model through pyspark.
word2vec_model = Word2VecModel.load("saving path")
After using that, I want to delete it since it will take much memory space on single node (I used the findSynonyms function, and the doc says it should be local used only)
I tried to use
del word2vec_mode... | 1 | 1 | 0 | 0 | 0 | 0 |
I am developing a chatbot that asks the user the information that is not there in the database.
Consider the database has 40 details for every person: Name, Age, Fav food, Fav Restaurant, Fav city, Reason for Fav City, Four the most liked things in the city,etc.
So, the questions can be
"What is our name?"
"Why do yo... | 1 | 1 | 0 | 0 | 0 | 0 |
i've combined two different datasets so that one column has text and another column has the sentiment score (binary 0, 1)
I'm trying to make a linear regression model that predicts sentiment based on words used in the text,
so far to preprocess the text, i changed the text to lowercase for all texts.
i'm wondering wha... | 1 | 1 | 0 | 0 | 0 | 0 |
I've already built a server which contains several spring boot microservices, and we've also wrote a python script to train AI models.
Now we want to build a service into this server to check our data at a specific time every day and run the python script to train the model.
Is there a good way to design this service? ... | 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to perform a word frequency count on a relatively large dataframe and don't know what approach would be the best.
Currently my dataframe looks like this -
Comment 'I' 'it' 'is' 'up'
'I was here' NaN NaN NaN NaN
'I like soup' NaN NaN NaN NaN
'whats up' NaN ... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm doing a pos tagging and the algorithm is Baum-Welch algorithm.
I want to send the types and tags in the .csv file but after running the code this error shows
untagged =pd.read_csv('test.csv','UTF-8','r')
print ('Tagging...')
#taggedOutput = doTagging(sent,untagged)
[w for w in sent if w in untagged]
tagged = pd... | 1 | 1 | 0 | 0 | 0 | 0 |
This example is for finding bigrams:
Given:
import pandas as pd
data = [['tom', 10], ['jobs', 15], ['phone', 14],['pop', 16], ['they_said', 11], ['this_example', 22],['lights', 14]]
test = pd.DataFrame(data, columns = ['Words', 'Freqeuncy'])
test
I'd like to write a query to only find words that are separated by ... | 1 | 1 | 0 | 0 | 0 | 0 |
how do I build a knowledge graph in python from structured texts? Do I need to know any graph databases? Any resources would be of great help.
| 1 | 1 | 0 | 0 | 0 | 0 |
I tried to execute
pip install spacy
and it finally worked with Python 3.7 64 bit (not with 32 bit version) but after installation no other package imports like pandas are working. It seems that the installation is the root cause but after removing spacy the import error of pandas and many other packages is still the s... | 1 | 1 | 0 | 0 | 0 | 0 |
I am a bit confused on what it means to set trainable = True when loading the Universal Sentence Encoder 3. I have a small corpus (3000 different sentences), given a sentence I want to find the 10 most similar sentences.
My current method is:
1) Load the module
embed = hub.Module("path", trainable =False)
2) Encode all... | 1 | 1 | 0 | 0 | 0 | 0 |
How do you identify the correct definition of a word in a sentence using NLP in Python?
For example, you have two sentences that use the verb 'get' with two different definitions:
He got a bike for his birthday. (get = to obtain, receive, or be given something)
He got a taxi from the station. (get = to use a particula... | 1 | 1 | 0 | 0 | 0 | 0 |
I am using spacy to understand phrases and I am trying to differentiate between Nouns like food, beer, wine etc. and other nouns like yesterday and today.
I am not able to come up with an idea as to how to differentiate them.
query = input()
doc = nlp(query)
displacy.serve(doc,style="dep")
What can I do to d... | 1 | 1 | 0 | 0 | 0 | 0 |
I read a lot of articles that deal with different NLP classification tasks and I saw that most of them specify in the pre-processing section that they use replacement tokens:
e.g. We removed and replaced the URLs, emojis and punctuation with replacement tokens: <URL>, <EMOJI>, <PUNCT>.
I am quite new to this domain... | 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to build a model that among its implementation that it takes two text inputs and get a one-hot vector based on one of the indices of the input.
I created the following custom functions:
def get_index(text, word):
# get index
index = get_expression_indices(text, word)
id_seq = []
for i in ran... | 1 | 1 | 0 | 0 | 0 | 0 |
I am performing some NER on Arabic language. The code is as follows:
from polyglot.text import Text
blob = "مرحبا اسمي rahul agnihotri أنا عمري 41 سنة و الهندية"
text = Text(blob)
text = Text(blob, hint_language_code='ar') #ar stands for arabic
print(text.entities)
After executing above given code in ubuntu i get bel... | 1 | 1 | 0 | 0 | 0 | 0 |
Is there a good python library that specifically contains some kind of dictionary of common english "throw away words" such as "um", "uh" that I could use to clean up text for NLP?
Similarly, my colleague started making a list of slang/off words. I'd love a python library that finds all of these. His js code below do... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm getting this error when I'm trying to access to run this code:
word_embedding_matrix = np.load(open("word_embedding_matrix.npy", 'rb'))
FileNotFoundError
Traceback (most recent call last)
in ()
----> 1 word_embedding_matrix = np.load(open("word_embedding_matrix.npy", 'rb'))
FileNotFoundError: [Errno 2] No ... | 1 | 1 | 0 | 0 | 0 | 0 |
For training, I have to feed the model sequence of word vector. Each sequence has on average 40 words. So, if I use a dictionary of pre-trained word embedding (like Glove), For each sequence have to hit the embedding dictionary around 40 times and for each batch, it will be around batch_size*40 times. The dataset is di... | 1 | 1 | 0 | 0 | 0 | 0 |
I am going through this link to understand Multi-channel CNN Model for Text Classification.
The code is based on this tutorial.
I have understood most of the things, however I can't understand how Keras defines the output shapes of certain layers.
Here is the code:
define a model with three input channels for processi... | 1 | 1 | 0 | 1 | 0 | 0 |
I have trained a model for handwritten digits multiclass classification using CNN in Keras. I am trying to evaluate the model with the same training images to get an estimate of the accuracy of the algorithm; however, when I evaluate the CNN confusion matrix, it gives a one column only of the form:
[[4132 0 0 ... | 1 | 1 | 0 | 0 | 0 | 0 |
I need a wheel for SpaCy to fix my build issue. Where can I find it? The file name is supposed to be spacy-1.10.1-cp27-cp27mu-linux_x86_64.whl
They did have wheels before. I was using a 1.9.0 wheel but I need to upgrade it to 1.10.1 and I was not able to find one.
| 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to fit my model on Streamlit.io app, but I am getting the above Value-Error. But it doesn't give the same error on Jupyter Notebook Please any better approach will help a lot.
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
File "c:\users\8470p\a... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to write a Keras model that will learn to create recipes, but I'm having trouble passing the strings through the model.
My df consists of 3 columns, one of the name, ingredients, and instructions (showing the first 2 lines of the df):
title
0 [Grammie Hamblet's Deviled Crab]
1 [Infineon Raceway Bake... | 1 | 1 | 0 | 0 | 0 | 0 |
I have a pandas dataframe that looks like the following:
0 1 2
# A B C
1 D E F
2 G H I
# J K L
1 M N O
2 P Q R
3 S T U
The index has a repeating 'delimiter', namely #. I am seeking an efficient way to transform this to the following:
0 1 2 3
# A B C 1
1 D E F 1
2 G H I 1
# J K L 2
1 M ... | 1 | 1 | 0 | 0 | 0 | 0 |
I am using Spacy nlp.pipe() for getting doc objects for text data in pandas Dataframe column but the parsed text returned as "text" in the code has length of only 32. However, the shape of dataframe is (14640, 16).
Here is the data link if someone wants to read the data.
nlp = spacy.load("en_core_web_sm")
for text in n... | 1 | 1 | 0 | 0 | 0 | 0 |
I've amended the code found here. But i'm getting a dimension error in my in input, like below:
ValueError: Error when checking input: expected InputLayer to have 4
dimensions, but got array with shape (None, None)
This is my modified code (i'm running this on Colab):
#Power data classification/regression with CNN
... | 1 | 1 | 0 | 0 | 0 | 0 |
The Transformer model has the following params. I saved and reloaded the model using h5py. I get this errors only for few datasets.
h5f = h5py.File(path + '.model.weights.h5', 'w')
# Weights reloaded
variables = []
h5f = h5py.File(path + '.model.weights.h5', 'r')
for idx in sorted([int(i) for i in h5f]):
... | 1 | 1 | 0 | 0 | 0 | 0 |
Hi have my own corpus and I train several Word2Vec models on it.
What is the best way to evaluate them one against each-other and choose the best one? (Not manually obviously - I am looking for various measures).
It worth noting that the embedding is for items and not word, therefore I can't use any existing benchmarks... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to find out the similarity between 2 documents i.e 'document_1' and 'document_2'.
I'm using Doc2Vec Gensim's keyedvectors.py for finding similarity score.
score = model.docvecs.similarity_unseen_docs(trainedModel, document_1, document_2)
print(score)
Where score is negative.
Here document_1 and document_2 a... | 1 | 1 | 0 | 0 | 0 | 0 |
I am introducing myself to Natural Languaje Processing and artificial neural networks and I have followed this wonderful tutorial
Once finished it, I would like to know if there is any way to test the model with phrases that I can invent, (That film entertained me a lot) for example.
Because it is very good to know the... | 1 | 1 | 0 | 1 | 0 | 0 |
I have a saved model I trained on a small text (messaging) data corpus, and I'm trying to use that same model to predict either positive or negative sentiment (i.e. binary classification) on another corpus. I based the NLP model on a GOOGLE dev ML guide, which you can review here (if you think it useful - I used option... | 1 | 1 | 0 | 1 | 0 | 0 |
I've new to nltk and I notice that to create a lemmatizer object(after importing nltk package), both
WNlemma = nltk.WordNetLemmatizer
with no explicit importing of class WordNetLemmatizer and
from nltk.stem import WordNetLemmatizer
WNlemma = WordNetLemmatizer
where we explicitely import the class WordNetLemmatizer... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm looking to check the caption(text below each image) on a wikipedia article. I wish to parse those strings (mostly using regex) and then if it matches, I want to save the link of that image.
I've been importing wikipedia directly to parse text, but after looking around the net I saw I'd need a different kind of pars... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to export the fasttext model created by gensim to a binary file. But the docs are unclear about how to achieve this.
What I've done so far:
model.wv.save_word2vec_format('model.bin')
But this does not seems like the best solution. Since later when I want to load the model using the :
fasttext.load_faceboo... | 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to run one git repo on Google cloud. But the system could not find the library path.
myname@cloudshell:~/text-to-text-transfer-transformer (lastproject-258210)$ python3 -c "import t5; print(t5.data.MixtureRegistry.names())"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/... | 1 | 1 | 0 | 0 | 0 | 0 |
I would like to know what is the difference between token and span in spaCy.
Also what is the main reason when we have to work with span? Why can't we simply use token to do any NLP? Specially when we use spaCy matcher?
Brief Background:
My problem came up when I wanted to get index of span (its exact index in string d... | 1 | 1 | 0 | 0 | 0 | 0 |
Good morning all
Does anyone of you know a tool or an API or something that takes a sentence as input and as output, it gives the topics or keywords of this sentence?
I tried TextRazor in the online demo it works well like you can see in the screenshot
but when I used as a library in my python code it always gives me... | 1 | 1 | 0 | 0 | 0 | 0 |
I am having a problem on an implementation of LSTM. I am not sure if I have the right implementation or this is just an overfitting problem. I am doing essay grading using a LSTM, scoring text with score from 0 - 10 (or other range of score). I am using the ASAP kaggle competition data as one of the training data.
Howe... | 1 | 1 | 0 | 0 | 0 | 0 |
I currently have around 400K+ documents, each with an associated group and id number. They average around 24K characters and 350 lines each. In total, there is about 25 GB worth of data. Currently, they are split up by the group, reducing the number of documents need to process to around 15K at one time. I have run int... | 1 | 1 | 0 | 0 | 0 | 0 |
I am looking for algorithms that could tell the language of the text to me(e.g. Hello - English, Bonjour - French, Servicio - Spanish) and also correct typos of the words in english. I have already explored Google's TextBlob, it is very relevant but it got "Too many requests" error as soon as my code starts executing. ... | 1 | 1 | 0 | 0 | 0 | 0 |
Sentence:
'I understood that that morning did not work out for her but I would still like to to make an appointment with her. I mean if she does great lashes and it's just this one little hiccup in the beginning it's well worth it as far as I'm concerned.'
How do I remove escape characters to clean the data?
| 1 | 1 | 0 | 0 | 0 | 0 |
I am doing an object detection model to detect my custom objects which are streetlight and the label on the streetlight using yolov3.
So here's my question, I want my model to detect the label of the streetlight by drawing bounding boxes around it. After drawing the bounding boxes, I want the model to capture the image... | 1 | 1 | 0 | 0 | 0 | 0 |
I need assistance reshaping my input to match my output. I believe my issue is with my target variable. I am getting the error as stated in the title. I have tried .reshape and .flatten(). Please help, and thanks in advance
NEnews_train = []
for line in open('/Users/db/Desktop/NE1.txt', 'r'):
NEnews_train.append(li... | 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to see the available problems() but it is giving Error.
Can you please let me know if I am missing anything
>>> from tensor2tensor import problems
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\\Anaconda3\lib\site-packages\tensor2tensor\problems.py", line 22, in <m... | 1 | 1 | 0 | 0 | 0 | 0 |
Currently, I have a nested for-loop that amends a list. I'm trying to create the same output while using multiprocessing.
My current code is,
for test in test_data:
output.append([((ngram[-1], ngram[:-1],model.score(ngram[-1], ngram[:-1])) for ngram in
test])
Where test_data is a generator object, and model.... | 1 | 1 | 0 | 0 | 0 | 0 |
I am trying to use string.strip([char]) function in Python using char argument. I have used it previously for trimming text but with character argument, it is behaving a little odd. I am not able to understand what is the logic behind its working.
string = ' xoxo love xoxo '
# Leading whitepsace are removed
print(st... | 1 | 1 | 0 | 0 | 0 | 0 |
My neural network is not giving the expected output after training in Python. Is there any error in the code? Is there any way to reduce the mean squared error (MSE)?
I tried to train (Run the program) the network repeatedly but it is not learning, instead it is giving the same MSE and output.
Here is the Data I used... | 1 | 1 | 0 | 1 | 0 | 0 |
I am not able to download 'stopwords' from the nltk library.
nltk.download('stopwords')
The folder nltk_data doent have any sub-folder called 'corpora', is that causing the issue? if so how do I fix it?
[nltk_data] Downloading package stopwords to
[nltk_data] /Users/prasadkamath/nltk_data...
Traceback (most recent ... | 1 | 1 | 0 | 0 | 0 | 0 |
So I've been learning TensorFlow with this Computer Vision project and I'm not sure if I understand it well enough. I think I got the session part right, although graph seems to be the issue here. Here is my code:
def model_train(placeholder_dimensions, filter_dimensions, strides, learning_rate, num_epochs, minibatch_s... | 1 | 1 | 0 | 0 | 0 | 0 |
I have the challenge of find & replace patterns in order to normalize a paragraph. It's easier to understand with an example: I have a lot of words like:
nm5638238.tmp, nm23345.tmp, nm56382334.tmp, etc
myfile0x233454, myfile0x233124, myfile0x23AW54, etc
and so on. The thing is that I don't like the regex approach in ... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to get words that are distinctive of certain documents using the TfIDFVectorizer class in scikit-learn. It creates a tfidf matrix with all the words and their scores in all the documents, but then it seems to count common words, as well. This is some of the code I'm running:
vectorizer = TfidfVectorizer()
t... | 1 | 1 | 0 | 0 | 0 | 0 |
If I have some documents like this:
doc1 = "hello hello this is a document"
doc2 = "this text is very interesting"
documents = [doc1, doc2]
And I compute a TF-IDF matrix for this in Gensim like this:
# create dictionary
dictionary = corpora.Dictionary([simple_preprocess(line) for line in documents])
# create bow corpu... | 1 | 1 | 0 | 0 | 0 | 0 |
When running a train on an empty NER model, should I include only labeled data (data that contain necessarily at least one entity), or should I also include data that do not contain any label at all (in this case, teaching the model that in some circunstances these words do not have any label)?
| 1 | 1 | 0 | 0 | 0 | 0 |
I am new to python and machine learning. I want to plot Zipf's distribution graph for a text file. But my code gives error.
Following is my python code
import re
from itertools import islice
#Get our corpus of medical words
frequency = {}
list(frequency)
open_file = open("abp.csv", 'r')
file_to_string = open_file.read(... | 1 | 1 | 0 | 1 | 0 | 0 |
shall i replace NaN with zero, average, or minimum year "1900" in below case,
i am trying to clean below example dataframe the second item has no garage with 0 value in both GarageArea and GarageCars columns
Edit: to be clearer i am not looking for how to? I am looking for best value of the missing date i.e "min, avar... | 1 | 1 | 0 | 0 | 0 | 0 |
LSTM(
(embed): Embedding(139948, 12, padding_idx=0)
(lstm): LSTM(12, 12, num_layers=2, batch_first=True, bidirectional=True)
(lin): Linear(in_features=240, out_features=6, bias=True)
)
Train epoch : 1, loss : 771.319284286499, accuracy :0.590
=========================================... | 1 | 1 | 0 | 0 | 0 | 0 |
I have the following problem:
In English language my code generates successful word embeddings with Gensim, and similar phrases are close to each other considering cosine distance:
The angle between "Response time and error measurement" and "Relation of user perceived response time to error measurement" is very small, ... | 1 | 1 | 0 | 0 | 0 | 0 |
I’m new to pytorch and have been following the many tutorials available.
But, When I did The CHATBOT TUTORIAL is not work.
Like the figure below
What should I do and what is causing this?
| 1 | 1 | 0 | 0 | 0 | 0 |
I have taken the code from the tutorial and attempted to modify it to include bi-directionality and any arbitrary numbers of layers for GRU.
Link to the tutorial which uses uni-directional, single layer GRU:
https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
The model works fine, but when i us... | 1 | 1 | 0 | 0 | 0 | 0 |
I am using Spacy for NLP in Python. I am trying to use nlp.pipe() to generate a list of Spacy doc objects, which I can then analyze. Oddly enough, nlp.pipe() returns an object of the class <generator object pipe at 0x7f28640fefa0>. How can I get it to return a list of docs, as intended?
import Spacy
nlp = spacy.load('e... | 1 | 1 | 0 | 0 | 0 | 0 |
In spacy, I'd like characters like '€', '$', or '¥' to be always considered a token. However it seems sometimes they are made part of a bigger token.
For example, this is good (two tokens)
>>> len(nlp("100€"))
2
But the following is not what I want (I'd like to obtain two tokens in this case also):
>>> len(nlp("N€"))
... | 1 | 1 | 0 | 0 | 0 | 0 |
Unable to find where did my pattern go wrong to cause the outcome.
The Sentence I want to find:"#1 – January 31, 2015" and any date that follows this format.
The pattern pattern1=[{'ORTH':'#'},{'is_digital':True},{'is_space':True},{'ORTH':'-'},{'is_space':True},{'is_alpha':True},{'is_space':True},{'is_digital':True},{'... | 1 | 1 | 0 | 0 | 0 | 0 |
I am a beginner in NLP and it's my first time to do Topic Modeling. I was able to generate my model however I cannot produce the coherence metric.
Converting the term-document matrix into a new gensim format, from df --> sparse matrix --> gensim corpus
sparse_counts = scipy.sparse.csr_matrix(data_dtm)
corpus = matutils... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm just starting to use NLTK and I don't quite understand how to get a list of words from text. If I use nltk.word_tokenize(), I get a list of words and punctuation. I need only the words instead. How can I get rid of punctuation? Also word_tokenize doesn't work with multiple sentences: dots are added to the last word... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm searching for a way to make sure any time the sequence "#*" appears in the text, spacy gives me the token "#*". I tried every possible way of adding special cases with add_special_case, building a custom Tokenizer using prefix_search, suffix_search, infix_finditer and token_match, but there are still cases when if ... | 1 | 1 | 0 | 0 | 0 | 0 |
I am wondering if it is possible to write a telegram bot that will answer similar to FAQ questions of any chosen website. Since I couldn't find any examples similar to my idea, I've decided to post this question here.
Probably, it is worth using DialogFlow framework here, but, again, there are no examples on the web.
| 1 | 1 | 0 | 0 | 0 | 0 |
So I have texts that look like the one below:
He also may have
recurrent seizures which should be treated with ativan IV or IM
and do not neccessarily indicate patient needs to return to
hospital unless they continue for greater than 5 minutes or he
has multiple recurrent seizures or complications such as
as... | 1 | 1 | 0 | 1 | 0 | 0 |
I have seen others have posted similar questions. But the difference is I'm running a Keras Functional API instead of a sequential model.
from keras.models import Model
from keras import layers
from keras import Input
text_vocabulary_size = 10000
question_vocabulary_size = 10000
answer_vocabulary_size = 500
text_input... | 1 | 1 | 0 | 0 | 0 | 0 |
I know how word2vec works, but I am having trouble with finding out how to implement word sense disambiguation using word2vec. Can you help with the process?
| 1 | 1 | 0 | 0 | 0 | 0 |
I use LibShortText for short-text classification.
I trained a model and use it to get class predictions on my test set by running:
python text-train.py -L 0 -f ./demo/train_file
python text-predict.py ./demo/train_file train_file.model output
The output file contains the score of each class for each test sample. She i... | 1 | 1 | 0 | 0 | 0 | 0 |
def resolveSentences(s1, s2):
"""
given two sentences s1 and s2 return the resolved sentence
"""
clauses = []
for p1 in s1:
for p2 in s2:
if p1.name == p2.name and p1.sign != p2.sign:
s1 = remove(p1,s1)
s2 = remove(p2, s2)
s = None
if s1 and s2:
... | 1 | 1 | 0 | 0 | 0 | 0 |
I have downloaded the treetagger wrapper for python from pip to use it for POS tagging purposes, Also i have downloaded the official Treetagger application from http://www.smo.uhi.ac.uk/~oduibhin/oideasra/interfaces/winttinterface.htm
Also I have downloaded the language model file for english the one with the name "eng... | 1 | 1 | 0 | 0 | 0 | 0 |
I'm trying to start with NLP using Python using nltk or spaCy.
My question is, if I have the sentence, 'Barack Obama was the former President of united states', How can I retrieve the word president to provide the class of the entity?
| 1 | 1 | 0 | 0 | 0 | 0 |
I know that that SpaCy provides start and end of each entity in a sentence. I want the start of the entity in the whole document (not just the sentence).
| 1 | 1 | 0 | 0 | 0 | 0 |
I did extraction of text from image. I got unstructured data after extracting text. I have to convert this to a structured form but I'm not able to do the so.
The unstructured data extracted from image in python:
EQUITY-LARGE CAP ©@ SBIMUTUAL FUND
A’ A PARTNER FOR LIFE
LSS LAST DIVIDENDS Ct EV a A)
i Option NAV @) Rec... | 1 | 1 | 0 | 1 | 0 | 0 |
I'm doing a Text Classification (NLP) model using fastai train on googlecolab (gpu) after I load the model using load_learner without any error but when I change the cpu usage, I get an error "RuntimeError: _th_index_select not supported on CPUType for Half"
Is there any way for me to predict cpu usage results?
from fa... | 1 | 1 | 0 | 0 | 0 | 0 |
I am using spacy to match a particular expression in some text (in italian). My text can appear in multiple forms and I am trying to learn what's the best way to write a general rule. I have 4 cases as below,, and I would like to write a general patter that could work with all of the cases. Something like:
# case 1
tex... | 1 | 1 | 0 | 0 | 0 | 0 |
I have a text dataframe like this,
id text
1 Thanks. I appreciate your help. I really like this chat service as it is very convenient. I hope you have a wonderful day! thanks!
2 Got it. Thanks for the help; good nite.
I want to split those text sentences and match them to each id. My expected outpu... | 1 | 1 | 0 | 0 | 0 | 0 |
I am new to spacy and i am trying to match some measurements in some text. My problem is that the unit of measure sometimes is before, sometimes is after the value. In some other cases has a different name. Here is some code:
nlp = spacy.load('en_core_web_sm')
# case 1:
text = "the surface is 31 sq"
# case 2:
# text =... | 1 | 1 | 0 | 0 | 0 | 0 |
I ran a word2vec algo on text of about 750k words (before removing some stop words). Using my model, I started looking at the most similar words to particular words of my choosing, and the similarity scores (for model.wv.most_similar method) are all super close to 1. The tenth closest score is still like .998, so I fee... | 1 | 1 | 0 | 1 | 0 | 0 |
I am attempting to implement the algorithm from the TD-Gammon article by Gerald Tesauro. The core of the learning algorithm is described in the following paragraph:
I have decided to have a single hidden layer (if that was enough to play world-class backgammon in the early 1990's, then it's enough for me). I am pret... | 1 | 1 | 0 | 0 | 0 | 0 |
I have a TF IDF vocabulary I already get from gensim or tfidfvectorizer. Is there any specific metric or method to drop tails of TF IDF vocabulary? I mean tails at Zipf diagram. How to visualize it?
I would like to see how accuracy changes when I drop number of words in vocabulary. For instance, I have vocabulary that... | 1 | 1 | 0 | 1 | 0 | 0 |
I have a custom rule matching in spacy, and I am able to match some sentences in a document. I would like to extract some numbers now from the matched sentences. However, the matched sentences do not have always have the same shape and form. What is the best way to do this?
# case 1:
texts = ["the surface is 31 sq",
"t... | 1 | 1 | 0 | 0 | 0 | 0 |
I would like to know if it's possible for me to use my own tokenized/segmented documents (with my own vocab file as well) as the input file to the create_pretraining_data.py script (git source: https://github.com/google-research/bert).
The main reason for this question is because the segmentation/tokenization for th... | 1 | 1 | 0 | 0 | 0 | 0 |
The excel file contains Indian language data. The excel file is being read but while displaying the content it shows \u200d in between. I need to avoid it to do further processing of data. Kindly help.
| 1 | 1 | 0 | 0 | 0 | 0 |
I have 2 node2vec models in different timestamps. I want to calculate the distance between 2 models. Two models have the same vocab and we update the models.
My models are like this
model1:
"1":0.1,0.5,...
"2":0.3,-0.4,...
"3":0.2,0.5,...
.
.
.
model2:
"1":0.15,0.54,...
"2":0.24,-0.35,...
"3":0.24,0.47,... | 1 | 1 | 0 | 0 | 0 | 0 |
As far as I'm concerned, there is no question like this. I'm working on a NLP and sentiment analysis project in Kaggle and first of all I'm preparing my data.
The dataframe is a text column followed by a number from 0 to 9 which categorizes which cluster does the row (the document) belongs.
I'm using TF-IDF Vectorizer... | 1 | 1 | 0 | 1 | 0 | 0 |
So I have a simple dataframe in pandas, where one of the column consist of tweet messages. Each cell or row contains a tweet message. I am trying to do a word frequency count to detect what are the top 10 words in my dataframe. Reason being to remove them from my dataset by adding them to my list of stopwords.
Tried a... | 1 | 1 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.