Code Monkey home page Code Monkey logo

how-to-build-own-text-summarizer-using-deep-learning's People

Contributors

aravindpai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

how-to-build-own-text-summarizer-using-deep-learning's Issues

Expected Operation, Variable, or Tensor, got 1

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

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

KeyError

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

Key Error

I'm getting follwing error
how can I solve?

 sampled_token = reverse_target_word_index[sampled_token_index]
KeyError: 0

Repeated output in the predicted value

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.

image

Kindly do the needful.I could not figure out where the problem is (Have tried using different optimizers,but that did not help!)

AttributeError: 'numpy.ndarray' object has no attribute 'lower'

#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

from CSV to TXT

Hello ,
I want to change from the input of CVS file to TXT file .
Is there any way?
Thank you.

TypeError: Expected Operation, Variable, or Tensor, got 0

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

unable to understand how X and y are being sent into model.fit

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:]))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.