Jump to content

zak100

Senior Members
  • Posts

    233
  • Joined

  • Last visited

Everything posted by zak100

  1. Hi, Yes. I want to follow thesame approach. But I need something which can be implemented in Python. Zulfi.
  2. Hi, Yes, a ML network only for Smart contract (SC) related vulnerability detection. Zulfi.
  3. Hi, Kindly suggest me some other deep learning technique for my example? Also kindly provide me the python implementation link. Zulfi.
  4. Hi, \(S→Ad,A→aAa|bAb|c\ What I understand that 'd' is not allowed in the middle. Based upon this : \(S--> aSaS)\ \(--->bSbS)\ \(--->c)\ \(---->d)\ I think that the above rules are not correct because we can put 'd' in the middle. Please guide me. Zulfi.
  5. Hi, Thanks. Can we implement CNN in python? Is there any good python link for ML(Machine learning)? Zulfi.
  6. Hi, Kindly guide me what for CNN stands and which package of python can be used for creating this network? Provide me any Python link to it. Zulfi.
  7. Hi, <I would not do that. If there is insufficient data to train and test the model then the project is going to fail> You mean I should have the same number of contracts that he(author) used. I mean I have to use around 1 million contracts for ML to work properly?? Zulfi.
  8. Hi, Ghideon: I am referring to the comment of PoetheProgrammer "so there may be a simpler network you could use for your problem." That's why I am asking what he means by a simpler network. <2: Do you have the data required for training the model? > He used 0.6 million contracts, I don't know to download them but I can create a data of 20 to 30 contracts but this would be my next question. First we have to settle on what machine learning (ML) network we would be using. I am saying ML because I want to concentrate on middle layers. We need more hidden layers. So kindly guide which package I am to use in Python for creating a simpler network but have more hidden layers. Zulfi.
  9. Hi, PoetheProgrammer: Please tell me a simple ML network for this problem and what is the best way to create it? Can we do it using Python? Ghideon: Thanks for your response. Zulfi.
  10. Hi, I want to implement a Machine learning based vulnerability detection tool for Smart Contracts. I have found a paper related to this implementation. I have attached it. SOmebody please guide me how to implement LSTM (Long Short Term Memory). Towards Safer Smart Contracts A Sequence Learning Approach_HW.pdf
  11. Hi, I think you have provided a valid point related to the budget. It requires a team to develop this sort of project. Also I have to interact this python project with php. This is another problem. Okay thanks for your reply. Zulfi.
  12. Hi, <What is your purpose and the ambitions with the code and questions? A: Is your goal is to understand the basics of a Markov chain and generate random texts with a simple program for personal use*? or B: Do you intend to actually use the program in a production environment where users will expect useful responses and help to solve real tasks? (Or some other goal? A and B are examples)> As far as your reply (i.e. part A) is concerned, I am able to understand Markov chain to some extent. I had to develop it as a project but one of the objective of the project is to use the project for departmental purpose but I think I am out of that race because my prototype focussed only on one case. But the advantage of my technique is that it is not wholy based on AI which gives odd and unpredictable results. But forunately I showed it to my friend and he says that it has high demands for physians because they look for something like a pager and my application is similar to that. So kindly show me both the aspects as my implementation would depend on simplicity and my understanding. So without seeing both the approaches, I can't say which one is eay for me to implement. Thanks for your time. God blesses you. Zulfi.
  13. Hi, Thanks for your information. Can you please guide me how to ask this question? Zulfi.
  14. Hi, Thanks for talking about this. Yes you are right. I used array instead of list and it worked. Following assignment becomes very difficult to handle: matched = [] and you are right: I tried the following and I think it worked: matched = ["", "", "", "", ""] and you are saying this: This means that if I use matched.append (i), I don't need the index and I don't have to initialize "matched" by null values as I did above. Zulfi.
  15. Hi, I think you have talk some thing very useful but you forget to provide some examples. You have some terms in your answer but I can't understand unless you provide some examples if you have time. This would be useful for others also. This is what I need: I'll have to provide something short that allows for a discussion. (please provide an example, what is short you are talking about?) Hardcoding a limited user input will not work in a real situation. (what else you want? do you want more hard coded data or do you want deviation from hard coding?) I would use more powerful preprocessing; (for example?) selecting a proper framework depends on many parameters not in the scope for this thread. (please provide more details, what you mean by framework? Are you talking about ML (machine learning), but every body is doing that) I would use my experience to look at the architecture (again please elaborate what you mean by this?) and overall design (it would be good if you tell us more about it) and not only parts of the coding. (sorry please provide more description). If you discuss more this would be very useful for improving this Markov ChatBot. God blesses you. Zulfi.
  16. Hi, <What kind of comment you are looking for? Since tSpeech is undefined I guess you shared a part of a program. > If you look at the stack exchange code, it has Speech variable which takes input from the user but I am combining all the user inputs and storing it into "tSpeech". <As far as I can tell the the programs posted above provides random answers based on input and training data, potentially providing quite humorous responses> No I have tried to get rid of humorous type of stuff which you last time termed as "joke". You can see that the first time, I got : "the following information: Your Course#," so bot is asking to get input from the user, we want to store all the user information and then a human would use this information to contact with the user. So I am systematically colectig the information. If the Markov Bot will not display something like the above, it would keep trying. Once it displays something like the above or like: ""the following information: Your Email address," its job would end and then the programming will come into play to retrieve the remaining information information about the user. So my approach is focussed, but you are right initially its random and this was necessary otherwise I won't be able to have AI part. Okay can you tell me something better for this from your experience: NEmailCWPmust=["email"] NEmailCWPany1 = ["professor", "dr.", "dr", "teacher"] NEmailCWPany2 = ["contact","contacting", "reply", "replying", "response","responding", "answer", "answering", "emailing"] NEmailCWPany3 = ["no", "not"] if "email" in tSpeech: #print("Found1") if any(x in tSpeech for x in NEmailCWPany1): #print("Found2") if any(y in tSpeech for y in NEmailCWPany2): #print("Found3") if any(z in tSpeech for z in NEmailCWPany3): This means I have several MarkovBots as said by PoetheProgrammerand I am directing the control to a specific MarkovBot using the above code but do you have a better strategy? Zulfi.
  17. Hi, Following is my output: /home/zulfi/PycharmProjects/chatbot/venv/bin/python /home/zulfi/PycharmProjects/chatbot/MarkovBot.py >professor not emailing :professor not emailing responseBot= the following information: Your Course#, >2216 :professor not emailing:2216 the following information: Your Professor’s Name, >ABCD :professor not emailing:2216:ABCD the following information: Your Course’s Name, >First Course :professor not emailing:2216:ABCD:First Course the following information: Your R#, >12345 :professor not emailing:2216:ABCD:First Course:12345 the following information: Your Email address, >zulfi@scienceForums.net I was just in a hurry so I dont have greetings message. The first message is generated by Bot using Markov chain. The remaining messages are generated programatically. The code for triggering this particular method handling "professor email problem" is: NEmailCWPmust=["email"] NEmailCWPany1 = ["professor", "dr.", "dr", "teacher"] NEmailCWPany2 = ["contact","contacting", "reply", "replying", "response","responding", "answer", "answering", "emailing"] NEmailCWPany3 = ["no", "not"] if "email" in tSpeech: #print("Found1") if any(x in tSpeech for x in NEmailCWPany1): #print("Found2") if any(y in tSpeech for y in NEmailCWPany2): #print("Found3") if any(z in tSpeech for z in NEmailCWPany3): #print("Before Entring prob_no_email bFistMesg=",bFirstMesg,"respBot=",responseBot,"totalResBot=",totalResponseBot,"newCnt=",newCnt) if(not response_string_generated): s = random.choice(speech.split())#Makov Code for generating firts message responseBot='' while True: neword=nextword(s) responseBot+=' '+neword s=neword if neword[-1] in ',?!.': break print("responseBot=", responseBot)#First Message generated by Markov Code totalResponseBot = totalResponseBot + responseBot list = prob_no_email_contact_with_professor(bFirstMesg, responseBot, totalResponseBot, newCnt)#generates the remaining messages The contents of my training file are: #training file starts Kindly provide us following information: Your Professor’s Name, Your Course’s Name, Your Course#, Your R#, Your Email address. Don’t worry, we try to contact with your professor but we need the following information:Your Professor’s Name, Your Course’s Name, Your Course#, Your R#, Your Email address. Not a problem, Kindly tell us: Your Professor’s Name, Your Course’s Name, Your Course#, Your R#, Your Email address. Okay we would help you, we need: Your Professor’s Name, Your Course’s Name, Your Course#, Your R#, Your Email address. #training file ends Thanks all for helping me, God blesses you. Zulfi.
  18. Hi, Somebody please guide me how to develop Ethereum Smart Contract (SC) tool for dynamic analysis? If there is a link for a dynamic analysis tool kindly provide me. Otherwise give a me general idea and the steps and hints how to complete those steps. Zulfi.
  19. Hi, Yes. I have completed one part. I now know how to modify the program. If I don't forget, I share my code and ask about your comment. Maybe today. Thanks a lot for keeping in touch. Zulfi.
  20. Hi, Answers to your questions: Which debugger have you tried? PyCharm By generating a ">" do you mean an input prompt or that program prints ">" or something else? You are right, its input Which line in the program generated ">"? This was in another file: You are right, I discussed this problem here also and provided the link: You also posted the link <Also note that you open a local file 'war&peace.txt'. It may be easier to help if you post an example that does not rely on local data? Are you sure the program finds and is capable of opening war&peace.txt? Note that some systems may have issues with a file name containing "&". > It opens the file crrectly. I have gone ahead of this problem and its working fine but just developed only for one particular problem. Zulfi.
  21. Hi, Thanks. The correct concept is: ind = response.find("Your Email address)
  22. Hi, I am trying to find out the index of a substring in a string. "in" tells that the string is present but "find" is returning -1. import numpy as np cnt = 0 response = "the following information: Your Email address." ind = "Your Email address".find(response) print("index =", ind) if "Your Email address" in response: print("Yes") Somebody please guide me how can I get the index of substring in the string. Following is the output: Zulfi.
  23. response= "the following information: Your Course’s Name," cnt = 0 matched = [] userInfoToRetrieve = ["Your Professor’s Name", "Your Course’s Name", "Your Course#", "Your id#", "Your Email address"] for i in range(5): print("i= ", i) if userInfoToRetrieve[i] in response: matched[cnt] = i cnt = cnt + 1 print ("cnt =", cnt) if cnt > 0: break print ("cnt = ", cnt) Hi, I am getting following error in the above program: Somebody please guide me. Zulfi. Hi, I have solved this problem: matched = np.empty(5) Zulfi.
  24. Hi, Thanks for your response. Looks like my guesses to line#7 and line#10 are correct that's why you have not provided any answer to my questions. Zulfi.
  25. Hi, Thanks for your information. You are right, ">" means input. Actually there is another file which runs first and that file contains the ">", symbol. The code from that file is: import pickle,random a=open('lexicon-luke','rb') successorlist=pickle.load(a) a.close() def nextword(a): if a in successorlist: return random.choice(successorlist[a]) else: return 'the' speech='' while speech!='quit': speech=input('>') s=random.choice(speech.split()) response='' while True: neword=nextword(s) response+=' '+neword s=neword if neword[-1] in ',?!.': break print (response) I am able to understand this code. 1a=open('lexicon-luke','rb')//opens a file 2successorlist=pickle.load(a)//retrieve the data stored in the pickle and assign it to successor 3a.close()//close that file Then jump to the following code: 4speech=''//set speech to null value 5while speech!='quit'://loop runs until we type quit 6 speech=input('>')//displaythe input prompt 7 s=random.choice(speech.split())//?????? 8 response=''//create another variable response and assign it a null value 9 while True://loop starts 10 neword=nextword(s)//invoking the function nextword and pass it a random word retrieved from the input??? 11 response+=' '+neword//This will continue until we get a question mark, comma or a period 12 s=neword 13 if neword[-1] in ',?!.': 14 break 15print (response) 100if check==text[w] and text[w][-1] not in '(),.?!': Please guide me the operation of line#7, line#10 and the earlier statement i.e. numbered as 100. Zulf
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.