Jump to content

zak100

Senior Members
  • Posts

    233
  • Joined

  • Last visited

Everything posted by zak100

  1. Hi, I am trying to modify the following Python Pickle program. It always starts by generating a ">". I have tried to use "print" statements but it is ignoring them. Kindly guide me how to modify the program: import pickle #trainer program b=open('war&peace.txt') text=[] print("Testing the code") for line in b: for word in line.split(): text.append (word) b.close() textset=list(set(text)) follow={} print("Testing") print(text) for l in range(len(textset)): working=[] check=textset[l] for w in range(len(text)-1): if check==text[w] and text[w][-1] not in '(),.?!': working.append(str(text[w+1])) follow[check]=working a=open('lexicon-luke','wb') pickle.dump(follow,a,2) a.close() Somebody please guide me. Zulfi. Hi, I have got some idea. Please guide me what is the meaning of following code: if check==text[w] and text[w][-1] not in '(),.?!': I think its checking that 'check' is not equal to (),.?!. Any logic why its checking only 2 substrings of 'text'? Zulfi.
  2. Hi, For Markov chain, I have following question: Let's suppose in the context of college chatbot, which is responsible for handling all types of queries, how the chatbot can detect if the problem is related to fee, for example the users can have stated following types of sentences: =(1)s it possible to get some fee concession? My father is jobless =(2)I don’t have a job. How to pay the fees. Please help me =(3)Can I get a fee waiver? I have lost the job./My father has lost the job. =(4)I can’t pay the tuition, I was hospitalized due to Covid, please look into my problem. For (1) to (3), users have used the word "fee" which can be used for detection of the problem, but in (4) the user uses the word "pay", but there can other variations also like: =I don't have any money, and can't get any loan, please guide me with my semester debt? Please guide me how the bot can handle such situations? This is related to fee but there could be other sitautions also. Zulfi.
  3. Hi. Thanks for your response. Yes machine learning is part of AI techniques. If you think ML is good, I can switch towards ML. I need guidance either its ML or Markov. But your experience tells me that ML would be more easier for you. Prometheus: <What's the purpose of the project? Are you focused more on learning how programming a chatbot works, or do you just want a working product (or something else)? > Purpose of the project is the familiarity with this area and if possible come up with chatbot to handle student queries b/c of the current COVID-19 situation. People like to prefer more online interaction as compared to face to face. Zulfi.
  4. Hi, My friend you are right. Because the author showed some stuff which was a joke. I discussed with Ghideon also. Then we have to improve the response received from the Markove chain. You are saying that GPT-3 also does the same thing and Ghideon is saying that we can improve its response. So let's try to improve the response from the Markov instead of focussing on NN. <but you will still have to train it on that dataset> You mean that instead of using the war&peace stuff, I have to focus on my domain related messages? God blesses you. I would develop some messages and then ask you people about its chaining. Zulfi.
  5. Hi, Thanks for your response. <Is this a joke? > I was reading about the GPT-3 (thanks to our friend Prometheus), even though its generative, the author was saying that such jokes will occur. I have applied for its key. I have not yet received any email yet. Have you tried GPT-3? <What have you tried so far?> I have tried this Markovbot but now I am trying to use the randomization technique discussed in my other post. Along this I want to work on the NN if I get some advise from you. <How did you extract the intent of the user (I guess you did not yet)? > I don't think its possible with AI techniques, I have to use programming. <What data was used to train the bot to provide answers? > I used the paragraph from war&peace book as discussed in the stackexchnage post. <What did you use to capture the dynamic aspects of the response? > Thanks for increasing my knowledge. I did not know about this. Guide me how to handle such messages. I am thinking to write some program. If you have some ideas please let me know. I am thinking to change from grocery. Its hot right now but it requires lot of information. I am thinking to focus on student advisor. But it requires contacts of faculty which would be less as compared to stored items in a grocery store. Zulfi.
  6. Hi, Good information. It has provided some information about how to use it with Python. But as far as I understand it is not possible to do so right now. If anybody knows the trick of using GPT-3 with python please guide me. Zulfi. Hi, I got the code related to Markov at: Markov Code and it worked but not impressive to solve specific problems: The output is given below: >What is the date today count had sent him to Petersburg. >How are you the approach of the count had sent him to Petersburg. >What is your name the bearers, >where you live the cold listless gaze fixed itself upon nothing. >quit the young man he caught a momentary glimpse between their heads and backs of his gray, ==end bot program using Marov Chain Can we make it better? < Personally I would probably look into models based on neural network but in this case that is not an option: > Please tell me about NN solutions. I would look into that. I think its better to use NN as compared to hard coded data. Zulfi.
  7. Hi, Thanks a lot. I thought raw_input(..) is a user-defined function. Thanks it worked by changing raw_input(...) to input(...). Zulfi.
  8. 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=raw_input('>') s=random.choice(speech.split()) response='' while True: neword=nextword(s) response+=' '+neword s=neword if neword[-1] in ',?!.': break print (response) Hi, I got the above code from: https://stackoverflow.com/questions/5306729/how-do-markov-chain-chatbots-work I am getting following error: Somebody please guide me how to define raw_input(...)? Zulfi.
  9. Hi, Thanks for your response. <I do not see the connection between the title's Markov Chain and intent extraction in the context of a chatbot> Sorry I mean that the intent is something which is extracted from the user's message But I think that the code provided in the link just handles with providing reponse to the user. But to provide response we need to know what the user is asking in his message. Again, I am calling this as the intent of the user. We would provide the inten of user to the Markov chain and then the Markov chain wil generate the reponse. But the question is that how will we find the intent of user? Zulfi.
  10. Hi, I have found a link for creating a bot using Markov Chain:Markov Chain Code They have provided a "run" option also. My question about the program is that the program is showing the random unique responses? Am I right? It looks that the random unique responses are meaningful as far as English is concerned. It looks like they have provided different variations of same sentences. So the program only generates the sentences randomly. But to generate the random sentences we have to first identify the intent of the user, whether the user is asking about the price of item, whether the user is asking about the expiry date of item, whether the user is asking about the quatity of items in the stock (i.e. my objective is to create a bot for helping in buying online grocery items). Somebody please guide me. Zulfi.
  11. Hi, You are right, I did a course of NN sometime but since then I hate them because they took lot of time in training and result was nothing. I don't believe I have skills to make them work properly. Please provide some link for Markov chain. Zulfi.
  12. Hi, Thanks for your response. Good ideas. I can try with that trivial approach. God blesses you. Howver, I have to incorporate some AI technique. Zulfi.
  13. Hi, Thanks. God blesses you. What is the purpose of classification model and training? Kindly check the link at developer refinitive. What is the pupose of context? How we should be using it? Zulfi.
  14. Hi, I am trying to built a chatbot. I found following link: developer refinitive I am following the above link, its creating a intents file, It has some fields with their values separated by colons. "intents":[ { "tag":"greeting", "patterns":["Hi there","How are you","Is anyone there?","Hello","Good day"], "responses":["Hello, thanks for asking","Good to see you again","Hi there, how can I help?"], "context":[""]}, One other link (https://www.pluralsight.com/guides/build-a-chatbot-with-python) shows set_pairs like: What is the difference between intents file and set_pairs? Zulfi.
  15. Hi, I want to built a chatbot to act as sale agent for grocery items. One option is to use Chatterbot. How we can built a chatbot from scratch? Kindly list the steps and provide the links. I have found some code here: https://www.pluralsight.com/guides/build-a-chatbot-with-python Kindly guide me how to extend the above code. Zulfi
  16. Hi, I can't understand the difference between Transponder only entry Toll booths and Transponder only exit Toll booths. As far as I understand , Transponder entry only Toll booths checks whether Transponder is operational or not and Transponder only exit Toll booths can do the transaction and deduct the Toll from the account associated with Transponder. But if the Transponder exit only toll booths can perform the payment, they can also do the detection, then why we need the Transponder only entry Toll booths? Somebody please guide me. The details are available at the following link: https://www.diqutech.com/highways.html Zulfi.
  17. Hi, Now I am able to understand the whole system. I want to create two modules: entry and exit with transducer. I have now following tasks: Car enters the transponder only lane and is detected for this. Now the system has to detect the transponder inside the car and to charge the car for payment or to detct violation.How should I divide these tasks into "entry with transducer" and "exit with transducer modules". Sorry this is Software Engineering part now. Zulfi.
  18. Hi thanks, I understand, you mean they would check for registration of transponder with the Toll System. If the number plate's number not in their system then its a viloation otherwise its a malfunction of Transponder. Thanks. God blesses you.
  19. Hi, I have a confusion about transponders in automated Toll Systems. I know that they are useful to avoid huge traffic gathering at the Toll booths. But then we have transponder only lanes. Transponders are detected by sensors. But how these fast vehicles fitted by transponders are charged with Toll fees. I mean once the car is detected in the transponder lane what are the remaining functions till the car leaves through the transponer only exit lane and how they performed? There are no barriers, so if there is a problem with the transponder, how this problem is detected if the car leaves through the transponder only exit lane. Some body please guide me. Zulfi.
  20. Hi, I have created a bysian network using samiam tool. In the diagram, I have shown 3 major issues but let’s consider that there are 4 issues and I have got following data related to Texas state: C19=COVID19 = 38% EJ= Economy and Job (28%) R=Racism(9%) HC = Health care = (9%) Party Affiliations: D= Democrat = 39% Re =republican= 40% N = neutral There are total 17 million voters Somebody please guide me how can I use the above data to predict the inclination of voters to one of the two candidates in a two party System where one of the candidates is the incumbent (i.e. I want to get an estimate of the actual number of voters inclined towards a candiddate).Please feel free to suggest the modifications. Please guide
  21. Hi, Thanks for your reply. <You’ll also need data about each states views on the issues at hand in order to properly account for them otherwise you’re just guessing. > I would search. Right now I have found general issues which I think are applicable to all states but of course there are issues like Economy, Climate Change, Migrants which can relate to other states. < I would start with modeling an individual state (e.g. Texas) and building a backtester to verify results.> This is what I wanted to do because I don't know how to create a network. Once I evaluate the results (wrong/right probabilities ) but with a correct nectwork, I think I can do that for other states. Please guide me how to establish dependencies and how to assume values for conditional probabilities table (CPT). Zulfi.
  22. Hi, I am trying to create a Byesian network to predict about the election results. For this election there are some important issues (I would call them as nodes) like EV, CD19, BLM, and WSM. I can assign some values to them. And then we can have two candidates, T and B, they belong to some party and these parties have workers. Now I have to arrange the nodes to indicate the dependencies and then assign conditional probabilities. Kindly guide me how can I improve my approach and what values should I assign to conditional probabilities and how to estbalish the network. Zulfi.
  23. Hi, This problem has been solved here: https://math.stackexchange.com/questions/3884163/proof-by-deduction-using-backward-reasoning Zulfi.
  24. Hi, I have to proof using backward reasoning. Wikipedia says its same as backward chaining and book says that it is same as goal driven search. I don't then why we call it "backward". Any way my question is: I have gt(5,2) and I have to prove it. For this purpose I am given a tree and some assumptions: Somebody please guide me. Sorry I don't have any idea. Should I try by doing the replacements provided at the end of each level of the tree? Linked concepts and Questions: By goal driven search it means that we have to start at the current state. How is it different from resolution proof? Zulfi.
×
×
  • 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.