aravindpai / how-to-build-own-text-summarizer-using-deep-learning Goto Github PK
View Code? Open in Web Editor NEWIn this notebook, we will build an abstractive based text summarizer using deep learning from the scratch in python using keras
In this notebook, we will build an abstractive based text summarizer using deep learning from the scratch in python using keras
Hello, @aravindpai and all, I am facing issue with
history=model.fit([x_tr,y_tr[:,:-1]], y_tr.reshape(y_tr.shape[0],y_tr.shape[1], 1)[:,1:] ,epochs=50,callbacks=[es],batch_size=512, validation_data=([x_val,y_val[:,:-1]], y_val.reshape(y_val.shape[0],y_val.shape[1], 1)[:,1:]))
TypeError: Expected Operation, Variable, or Tensor, got 1.
Can somebody help me, I don't understand how to fix it.
Thanks in advance.
While running inference on custom dataset getting KeyError: 0
Error log ->
KeyError Traceback (most recent call last)
in ()
----> 1 decode_sequence(x_tr[i].reshape(1,max_text_len))
in decode_sequence(input_seq)
19 sampled_token_index = np.argmax(output_tokens[0, -1, :])
20 print(sampled_token_index)
---> 21 sampled_token = reverse_target_word_index[sampled_token_index]
22
23 if(sampled_token!='eostok'):
KeyError: 0
How can i use the model to compute prediction for an inserted review by the user!!
Any help!
And how to overcome the problem of duplication in the output summary??!
I keep getting this error when i run this code
## Attention Layer
attn_layer = AttentionLayer(name = 'attention_layer')
attn_out, attn_states = attn_layer([encoder_outputs, decoder_outputs])
<---
Can anyone help me out?
I have got this key error. Please help me. Thank you
KeyError Traceback (most recent call last)
in ()
2 print("Review:",seq2text(x_tr[i]))
3 print("Original summary:",seq2summary(y_tr[i]))
----> 4 print("Predicted summary:",decode_sequence(x_tr[i].reshape(1,max_text_len)))
5 print("\n")
in decode_sequence(input_seq)
17 # Sample a token
18 sampled_token_index = np.argmax(output_tokens[0, -1, :])
---> 19 sampled_token = reverse_target_word_index[sampled_token_index]
20
21 if(sampled_token!='eostok'):
KeyError: 0
There is problem is training. the dimensions of decoder_outputs and attention_output
Unable to train in colab. help to train
Google colab taking too much time and crash
When i am running the code in model building, the following line of code is showing error
encoder_inputs = input(shape=(max_text_len,))
TypeError: raw_input() got an unexpected keyword argument 'shape'
I'm getting follwing error
how can I solve?
sampled_token = reverse_target_word_index[sampled_token_index]
KeyError: 0
Hi , I am doing a small project that involves text summarization.I tried implementing your model to my data set , but I am getting the same value repeatedly for every test case. Please find the attached image.
Kindly do the needful.I could not figure out where the problem is (Have tried using different optimizers,but that did not help!)
#prepare a tokenizer for reviews on training data
y_tokenizer = Tokenizer(num_words=tot_cnt-cnt)
y_tokenizer.fit_on_texts(list(y_tr))
#convert text sequences into integer sequences
y_tr_seq = y_tokenizer.texts_to_sequences(y_tr)
y_val_seq = y_tokenizer.texts_to_sequences(y_val)
#padding zero upto maximum length
y_tr = pad_sequences(y_tr_seq, maxlen=max_summary_len, padding='post')
y_val = pad_sequences(y_val_seq, maxlen=max_summary_len, padding='post')
#size of vocabulary
y_voc = y_tokenizer.num_words +1
I am getting this error at line 3
Hello ,
I want to change from the input of CVS file to TXT file .
Is there any way?
Thank you.
while running this code model.fit i am getting error :
TypeError: Expected Operation, Variable, or Tensor, got 0
" history=model.fit([x_tr,y_tr[:,:-1]], y_tr.reshape(y_tr.shape[0],y_tr.shape[1], 1)[:,1:] ,epochs=50,callbacks=[es],batch_size=128, validation_data=([x_val,y_val[:,:-1]], y_val.reshape(y_val.shape[0],y_val.shape[1], 1)[:,1:])) "
TypeError: Expected Operation, Variable, or Tensor, got 0
The link you gave for attention layer in the starting of repo is not available please check!
Can you please explain what is happening where you are sending in y_tr[:,:-1] into as X into the model.
history=model.fit([x_tr,y_tr[:,:-1]],
y_tr.reshape(y_tr.shape[0],y_tr.shape[1], 1)[:,1:] ,
epochs=50,
callbacks=[es],
batch_size=128,
validation_data=([x_val,y_val[:,:-1]],
y_val.reshape(y_val.shape[0],y_val.shape[1], 1)[:,1:]))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.