Generating Poetic Texts with Recurrent Neural Networks in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.พ. 2025

ความคิดเห็น •

  • @ananthramvijayaraj4554
    @ananthramvijayaraj4554 3 ปีที่แล้ว +33

    Bro, I'm surprised that such nice videos have very little views. Really love the work and just want to tell you to keep up the grind!!

  • @dave_roul
    @dave_roul 10 หลายเดือนก่อน +4

    More than the coding itself I liked the way you explains the concept. Hope to see more😊

  • @TesterRight
    @TesterRight หลายเดือนก่อน

    Thank you for the invaluable video. I'm a novice in Python for AI, and I have been trying to find a good project to work on so I can gain hands-on experience. I came across this video, which is a gem. TBH, I love the way you simplify the complexity, making the video engaging and easy to understand. Keep going sir!

  • @matthewweitzner8956
    @matthewweitzner8956 3 ปีที่แล้ว +5

    Great tutorial! The website did not connect properly for me, but I then switched it out with some of my own writing that I converted to a .txt file. Wasn't as polished, but then again I'm not as prolific a writer as Shakespeare, so it had less training data. If you're considering starting the video, I would highly recommend. Also, afterwards you can edit the function so that you can input your own starting text if you want.

  • @ahmetyusuf4278
    @ahmetyusuf4278 5 หลายเดือนก่อน +18

    For all the newcommers in AI, quick tip: "lr" from the line “model.compile(loss=’categorical_crossentropy’, optimizer=RMSprop(lr=0.01))” has been chnaged to learning_rate in the newer versions. Enjoy!

    • @no-sb1ld
      @no-sb1ld 3 หลายเดือนก่อน

      Thx

    • @amogusissus7075
      @amogusissus7075 หลายเดือนก่อน

      Can tensorflow-cpu also work?

    • @ahmetyusuf4278
      @ahmetyusuf4278 หลายเดือนก่อน

      @@amogusissus7075 I’m sorry no clue about that one 😅

    • @amogusissus7075
      @amogusissus7075 หลายเดือนก่อน

      @@ahmetyusuf4278 Alright, thanks

  • @RehaERMETin
    @RehaERMETin 6 หลายเดือนก่อน +8

    Just so people know in more recent versions of TensorFlow/Keras, the lr argument has been replaced with learning_rate

  • @lynx-me2ew
    @lynx-me2ew 3 ปีที่แล้ว +4

    def sample(preds, temperature=1.0):
    preds = np.asarray(preds).astype('float64')
    preds = np.log(preds) / temperature
    exp_preds = np.exp(preds)
    preds = exp_preds / np.sum(exp_preds)
    probas = np.random.multinomial(1, preds, 1)
    return np.argmax(probas)

  • @mishahappy1990
    @mishahappy1990 3 ปีที่แล้ว

    Really cool video. you deserve a lot of views

  • @SoulFrmTitanic
    @SoulFrmTitanic ปีที่แล้ว +5

    i saw you for the first time 8 years ago
    Rn, I'm 20...

  • @mohamedaminelahlal266
    @mohamedaminelahlal266 4 ปีที่แล้ว +10

    Can you upload more python for networking and "ethical hacking"? Continue your videos are awesome

  • @sakari.niittymaa
    @sakari.niittymaa 2 ปีที่แล้ว +1

    This is so good tutorial and excellent teacher! Thank you for your videos. +1 sub 👍

  • @raphaelmgonja8428
    @raphaelmgonja8428 ปีที่แล้ว

    i countered this problem from you code on chatbot
    ValueError Traceback (most recent call last)
    Cell In[168], line 21
    19 # Shuffle and convert to a NumPy array after the loop
    20 random.shuffle(training)
    ---> 21 training = np.array(training)
    23 train_x = list(training[:, 0])
    24 train_y = list(training[:, 1])
    ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (12, 2) + inhomogeneous part.

  • @michaelmcwhirter
    @michaelmcwhirter 8 หลายเดือนก่อน

    You're a good teacher 👍

  • @jory_a5218
    @jory_a5218 ปีที่แล้ว

    Thank u ❤ i do my project in univerfity from your code

  • @pragyavijay8556
    @pragyavijay8556 20 วันที่ผ่านมา

    Loved it!

  • @Memories-Lens
    @Memories-Lens ปีที่แล้ว +2

    is there any other specific thing do we have to learn other than python for these projects?

  • @Yukiehana
    @Yukiehana 4 วันที่ผ่านมา

    Hey, Im on Python 3.12, model.save("textgenerator.model") doesnt work, have to use textgenerator.keras, is that fine?

  • @mohorbanerjee5457
    @mohorbanerjee5457 ปีที่แล้ว +3

    Thanks for the amazing tutorial! But when I tried out with the exact same code, even for moderate temperatures like 0.6 and 0.8 I am getting very haphazardly generated results most of which doesn't really make any sense....may I know how do I obtain the refined results as were shown in the video for 0.6 and 0.8?

  • @sargamyadav1069
    @sargamyadav1069 3 ปีที่แล้ว +4

    Nice tutorial 😀. Could you please cover text generation for dialogue systems if possible?

  • @Spacesparx-h7q
    @Spacesparx-h7q 6 หลายเดือนก่อน

    I am following you for an a month your videos are great but could you make tutorial for sense analysis modal 😊

  • @eldranoson1243
    @eldranoson1243 7 หลายเดือนก่อน

    How would you be able to make it create more senseful text?
    Putting in all of the shakespear text instead of just a part of it?

  • @Memories-Lens
    @Memories-Lens ปีที่แล้ว

    man you are my savior , ly

  • @techandtalks6224
    @techandtalks6224 2 ปีที่แล้ว +4

    bro this line x[i, t, char_to_index[character]] = 1 is producing blunt,
    and rice ap thomas with a valian' error

    • @chrisstone2332
      @chrisstone2332 2 ปีที่แล้ว

      same error, not sure why! problem with the txt file?

    • @molla4097
      @molla4097 ปีที่แล้ว

      yes
      @@chrisstone2332

  • @vitocorleone1991
    @vitocorleone1991 3 ปีที่แล้ว

    Great job!

  • @shashwatbalodhi4042
    @shashwatbalodhi4042 ปีที่แล้ว

    @NeuralNine , Can you pls update it to the latest version of python as i wrote the exact same code but getting an error. By the way really loved the way you explain.

  • @RobertLogic
    @RobertLogic 10 หลายเดือนก่อน

    I just did this, I had to swap some things around to make it work though.
    How hard would it be to query this model like a bot?
    Is there something more specific to this that I can look up?

  • @aneeskhann3735
    @aneeskhann3735 10 หลายเดือนก่อน +1

    can someone name me the tool or framework used in this video to build the project

  • @arvis_1498
    @arvis_1498 4 ปีที่แล้ว +1

    Hey, nice tutorial, i do get ValueError: Input 0 of layer sequential not compatible with the layer on the predictions = model.predict

  • @navatej777
    @navatej777 6 หลายเดือนก่อน +1

    Man ! Where does he actually code ?

  • @jamesgraymane3911
    @jamesgraymane3911 ปีที่แล้ว

    M1 macos if u can directly import keras ,keras are not in tensorflow

  • @davidhovsepian-id1cv
    @davidhovsepian-id1cv ปีที่แล้ว

    this is great!

  • @harishreddy9814
    @harishreddy9814 ปีที่แล้ว

    Can you please share the github link for "generating Poetic text using recurrent Neural Networks".

  • @pushpanb1714
    @pushpanb1714 2 ปีที่แล้ว +1

    Hello
    I am getting error for this line
    x = np.zeros(len(sentences),SEQ_LENGTH,len(characters),dtype=np.bool)
    below is the error
    argument for zeros() given by name ('dtype') and position (position 1)

    • @bryanjesuscastrocoello2791
      @bryanjesuscastrocoello2791 2 ปีที่แล้ว +1

      same here did you find any solution?

    • @soundstranquility459
      @soundstranquility459 ปีที่แล้ว +1

      I got this error too. You can fix it by changing the x and y to
      x = np.zeros((len(sentences) * SEQ_LENGTH * len(characters)), dtype=bool)
      y = np.zeros((len(sentences) * len(characters)), dtype=bool)

    • @lololoololdudusoejdhdjswkk347
      @lololoololdudusoejdhdjswkk347 ปีที่แล้ว +1

      @@soundstranquility459 I get this error: "numpy.core._exceptions.MemoryError: Unable to allocate 1.01 TiB for an array with shape (166654, 40, 166654) and data type bool"

    • @soundstranquility459
      @soundstranquility459 ปีที่แล้ว +1

      @@lololoololdudusoejdhdjswkk347 Yes, sorry I just took another look at the API. you need to add an additional brackets to the original, since they updated the function. It should look like
      x = np.zeros((len(sentences), SEQ_LENGTH, len(characters)), dtype=bool)
      y = np.zeros((len(sentences), len(characters)), dtype=bool)
      the first parameter entry in the function is an n-tuple which determines the shape of the array, So for x, we are creating a 3-d array with sides of length (len(sentences), SEQ_LENGTH and len(characters), then specifying type boolean.

  • @riyacatherine3217
    @riyacatherine3217 ปีที่แล้ว

    What platform of python are we using in this video?Is it IDE,or pycharm or something else?

    • @pesk8801
      @pesk8801 ปีที่แล้ว

      he uses pycharm its inside an anaconda environment aswell

  • @Sencerylmz
    @Sencerylmz ปีที่แล้ว

    ı know python but ı don't anything about AI. Can ı learn AI through make these project?

  • @haithem4178
    @haithem4178 5 หลายเดือนก่อน

    can i start this playlist directly without any backhround of some other things? advise me plz!

    • @univ0602
      @univ0602 4 หลายเดือนก่อน +1

      You must have some basics in IA before to start this playlist... He has a playlist very interesting where he explains everything to know about IA basics

    • @haithem4178
      @haithem4178 4 หลายเดือนก่อน

      @@univ0602 oh thank lad can you tell me the name of the playlist too?

  • @veroxsity2336
    @veroxsity2336 2 ปีที่แล้ว +1

    tensorflow is not working on any version for me is there a fix to this

    • @Narumi-201
      @Narumi-201 ปีที่แล้ว

      check your python version tensorflow doesn't support the new version of python
      I got python 3.8.6 and it worked for me

    • @faizsyed_music
      @faizsyed_music 11 หลายเดือนก่อน

      Hey I've had this exact problem for a while. Don't know if you got it solved, but here's my steps: 1) I did "pip-install-tensorflow" in the terminal 2) once it was installed, the first import line is the same: "import tensorflow as tf" 3) But after this, any other module you import from tensorflow has to be imported in this format: "from tensorflow.python.keras" instead of just "tensorflow.keras" for example. Let me know if it works for you.

  • @vijaysamant2864
    @vijaysamant2864 ปีที่แล้ว

    I tried it and I am being bombarded with "and".

  • @KaZaDuum
    @KaZaDuum 2 ปีที่แล้ว +2

    Great video.
    I am getting this error.
    x[0, t, char_to_index[character]] = 1
    IndexError: index 40 is out of bounds for axis 1 with size 40

    • @zainrab8629
      @zainrab8629 ปีที่แล้ว

      its i instead of 0 i think

  • @onlyshorts6837
    @onlyshorts6837 ปีที่แล้ว

    can you mention python version , cuz the version 3.11 doesnt support tensorflow.keras.

    • @dodo5037_
      @dodo5037_ ปีที่แล้ว

      I don't think 3.10 supports it either

    • @faizsyed_music
      @faizsyed_music 11 หลายเดือนก่อน

      Hey I've had this exact problem for a while. Don't know if you got it solved, but here's my steps: 1) I did "pip-install-tensorflow" in the terminal 2) once it was installed, the first import line is the same: "import tensorflow as tf" 3) But after this, any other module you import from tensorflow has to be imported in this format: "from tensorflow.python.keras" instead of just "tensorflow.keras" for example. Let me know if it works for you.

  • @aimeritedonald6689
    @aimeritedonald6689 4 ปีที่แล้ว

    very cool !!

  • @bahookygeggie3704
    @bahookygeggie3704 4 ปีที่แล้ว

    yo for some reason theirs error coming up here
    x = np.zeros((len(senteces), SEQ_LENGTH, len(characters)), dtpye=np.bool)
    y = np.zeros((len(senteces), len(characters)), dtpye=np.bool)
    saying SyntaxError: invalid syntax

    • @baudys_dev
      @baudys_dev 4 ปีที่แล้ว

      intead of 'dtpye' write 'dtype'

    • @bahookygeggie3704
      @bahookygeggie3704 4 ปีที่แล้ว +1

      @@baudys_dev fuck of course

    • @Damion-nj8ou
      @Damion-nj8ou ปีที่แล้ว +1

      looks like spelling error on sentences and dtype.
      oops, two years ago.

  • @antoniorivolta
    @antoniorivolta 4 ปีที่แล้ว +2

    How can I import my own file in the code?

    • @NeuralNine
      @NeuralNine  4 ปีที่แล้ว +2

      Instead of downloading it you can directly load it with Python :)

    • @antoniorivolta
      @antoniorivolta 4 ปีที่แล้ว +1

      Thanks!

  • @fazlehadiazmat7g803
    @fazlehadiazmat7g803 ปีที่แล้ว +1

    what is this text editor

  • @thecritiquer9407
    @thecritiquer9407 5 หลายเดือนก่อน

    which IDE is he using?

  • @homataha5626
    @homataha5626 8 หลายเดือนก่อน

    I wish the background was white

  • @2wheelson2strokes
    @2wheelson2strokes 3 หลายเดือนก่อน

    Hey I am new to here i don’t know where to start can any one help me

  • @AhmedAfeef_.77
    @AhmedAfeef_.77 หลายเดือนก่อน

    Source code?

  • @BettyWilliams-v1q
    @BettyWilliams-v1q 4 หลายเดือนก่อน

    Joan Burgs

  • @ingilizanahtar644
    @ingilizanahtar644 3 ปีที่แล้ว

    harika

  • @niteshanthony2324
    @niteshanthony2324 ปีที่แล้ว +18

    If you declare with your mouth, “Jesus is Lord,” and believe in your heart that God raised him from the dead, you will be saved. 10 For it is with your heart that you believe and are justified, and it is with your mouth that you profess your faith and are saved.❤😊🎉

    • @algebra9707
      @algebra9707 8 หลายเดือนก่อน +11

      . This is a coding channel not a Gospels preacher

    • @ProfShibe
      @ProfShibe 8 หลายเดือนก่อน +12

      U need machine learning to fix your brain

    • @Homejest
      @Homejest 7 หลายเดือนก่อน +3

    • @VitalyEpifanov
      @VitalyEpifanov 6 หลายเดือนก่อน +2

      @@ProfShibelmaooo

    • @tinyflyingdragons9432
      @tinyflyingdragons9432 6 หลายเดือนก่อน +1

      Fuck off I'm Jewish let us learn coding

  • @RobertPayne-v7q
    @RobertPayne-v7q 4 หลายเดือนก่อน

    Mosciski Row

  • @IRAKOMEYEJOHNSONN
    @IRAKOMEYEJOHNSONN 3 หลายเดือนก่อน

    yeap

  • @vijaysamant2864
    @vijaysamant2864 ปีที่แล้ว

    1:59

  • @fire6930
    @fire6930 ปีที่แล้ว

    wtf

  • @yubinsolii7007
    @yubinsolii7007 หลายเดือนก่อน

    ModuleNotFoundError.
    I'm I alone?