Press "Enter" to skip to content

Watch Me Build a Finance Startup

pWatch Me Build a Finance Startupp phello world its Suraj and Ive built an app called artificial advisor that helps you manage your personal finances the point of this article is to show you how I built it so that you could build something similar yourself and make money with it so let me start off with a demo Ill start off by typing in my username and my password and this is just this is just test credential information and once Ive logged in its going to ask me to authenticate with my bank account now this screen is just there for testing purposes but once Ive logged in I can select many different bank accounts Ive integrated a service called plaid that lets us integrate multiple different bank accounts and Ill just pick one at random Bank of America say but theres a lot of different bank accounts Ive integrated here and Ill type in my test credentials and its going to show this beautiful credential loading screen thats going upwards and once Ive authorized its going to show me both my checking and my savings account balance and once I click on checking its going to authenticate that information its gonna pull all of my transactions directly from my bank accounts into my app then its going to display the categories of purchases that Ive made made in the past month and you know that could be food that could be transport whatever and it will visualize that as a pie chart as we see here then once it has all of that data its going to take a 1 cut of that and thats gonna be an investment thats what were gonna do were gonna take a 1 cut of your monthly budget and once Ive done that I have an artificial adviser that I can talk to Ill go ahead and say hello now Im going to ask my artificial adviser how how much is my balance just to see if what it is okay Ive got a hundred bucks in my bank account great now let me see what my budget is what is my budget and what its gonna do is its going to tell me the breakdown of my monthly budget right now it is allocating different amounts for different categories of purchases for me its allocated this itself and then Ill say ok great well based on this budget can I afford some products so Olive for example ask can I afford a Tesla Model S so that would go under transport it will pull the price of a Tesla from the Google API it will compare that to how much I have in my budget and its gonna say not this month its outside of the range of your budget of ten dollars in this test case great now Ill ask how are my investments doing how are my investments doing and it will say depending on what the price is your current investments in Apple and Google have this net have this loss end and win and the net gain is a dollar 28 for today what this app has done is it has selected some subcategory of stocks to invest in its youth sentiment analysis on Twitter data to see which stock it has a high sentiment for the day and then its invested in that stock using whats called the alpaca API Im gonna explain all of that but that is the demo for this article Im gonna show you how to build this so that you can build something similar now is the time to build an AI startup and if you want to continue to see these kind of educational articles on how to make money with AI hit the red subscribe button because Im gonna keep pushing them out every single week now thats what this app does Im gonna show you how I built it and that includes a lot of tools like firebase which lets us authenticate our users and gives us a database thats easily accessible in the cloud plaid which allows us to integrate with many many many different bank accounts any chart which lets us visualize the data that we pull from plaid dialogue flow which is Googles online tool which allows us to use NLP thats been pre trained to create an agent that can converse with our user will also use tensorflow to perform sentiment analysis on Twitter data and then well use the alpaca API to make trades in real time with zero Commission which is awesome so Im gonna show you how I put together all of these tools to build this app in this article ok so lets go ahead and get started I have a little short presentation five minutes on you know what this app is about and how its using AI and then well get right to the code alright so important question how this AI well its all considered natural language processing and heres how first of all the plaid API is an incredible API and what it does is it returns Bank data once Ive often Takei TEDWomen is and what does committed is gonna do is its gonna return that as a JSON response right its in the JSON format which is one of the many different formats that data can be sent via the HTTP server client model and in this case look at this the amount is gonna be 44 dollars and 87 cents in this example and its also got a category feature whether you know what is that transaction categorized as is it travel is it gas station purchases what is it and the way they do this is theyre using some kind of supervised model on their end theyve trained it on all of their transaction data on a course they have a lot of it and because of that theyre able to classify new transactions based just on what the text of that transaction was its gonna know the likelihood of what category its in so theyre taking care of that part of the AI process and its using some sort of neural network likely to make some kind of multiclass classification now how else is it using AI well its using intent classification and thats for using dialogue flow so the idea behind intent classification is a user could say different things they could say what is my budget how much money do I have allocated for this month what is my you know another word for budget the point is that we are shifting the paradigm from what a user says to what a user means and that is intent classification no matter what how they phrase a certain sentence the intent for all of those phrases that I just said is gonna be the same writes budget lookup is the intent for that so what dialogue flow allows us to do is to classify text and put it into these intent categories and once we have those intents then we can give a response whether its a hard coded response or whatever else and the way they do this is to take those words convert them into vectors and its very likely that theyre using their own model for this called Bert and I have a great article on this just search Bert Suraj on YouTube and the other way were using NLP is through text generation right our agent is not only able to give out hard coded responses but we can have it give some variants of a hard coded response and how does it give a variant of a hard coded response well it uses whats called text generation and the idea to be mathematical for a second is to instead of this estimating the probability of Y given X right the probability of a label given the input data its to estimate the probability of x given Y so its the opposite so what were doing is instead of instead of estimating a decision boundary you know yes no hot dog not hot dog were estimating the probability distribution of the data and a distribution shows all the potential possibilities for what value some data could be you know from 0 to 100 and so all the variations of what some data could be is contained in that probability distribution and so you know if we want to generate new types of pokemons based on an data set of existing pokemons whether we want to create some new type of response based on some existing take text data sets the point is that it finds some variation thats related but its not the exact same from the original training data set so one example in terms of text generation would be lets say its trained on a bunch of you know compliments you know one of the compliments its trained on is you know you your hair looks great today and after training using the distribution of all of those hair complements it would generate something totally different but related like your hair is fantastic and the word fantastic wasnt in there but its related and so word to Veck helps with that because it was pre trained on a bunch of word vectors lastly its using sentiment analysis to categorize each of the tweets that were pulling for each stock vo whats called a text CNN a text convolutional neural network and I have a great article on how that works as well search text CNN Siraj once we have the sentiment for each of those stocks were gonna make a trade based on what we consider to be the highest scoring sentiment stock for the day now before we you know get started with the coding and so I just want to say that this is not enough to make a you know great amazing trade right this is just one data point tech you know sentiment analysis is one data point to add to our investment model now but remember this app isnt just doing investment its its allocating your budget to telling you whether or not you can spend a certain amount and then so investment is just a part of that and so this is just a boiler boiler plate to prototype we can continue to build that investment model you know instead of just adding sentiment and our analysis we can add some cloud function in firebase that uses deep reinforcement learning to make trades in real time and theres a lot of ways we can improve that we can add back testing but the point of this is not just investment investment is one part of this theres a lot more to this how much can I spend can I afford a certain product letting us know whether or not we can afford something right we make these investment decisions ourselves with our own money but were not that good at least let me speak for myself well I am pretty good but I could be better everybody could be better okay so the point is that thats what thats at thats how its using AI now applications of AI and Finance last step before we get into the code there are lots of opportunities here right now is it time to start an AI start and that could be in credit scoring it could be in asset management this is just one example of startups and companies that are using AI to solve some really hard problems basically anytime you can think of something that a human is doing in finance theres a very very high chance that an AI can do it just as well and that the problem is that e AI is the new electricity but just like electricity was invented it had to be propagated throughout the world for it to be used thats our jobs as an engineers well we have to propagate this technology by building startups thats how AI is going to influence society so theres a lot of room for great AI FinTech startups as this now is the time to build that very few people realize just how accessible this technology is to anybody anywhere and just how powerful it is and very few people have the knowledge not just of those two data points but how to build it and so my goal for this article is to do all three of those to get you excited yes you can build this I want you to build this in fact I have an ongoing AI saw challenge that that is you know look at look on my Twitter feed that its incentivizing people to build with this alright so lets get right into building right so first of all step one the structure of the app what do we want our app to look like so Im building this for Android which is a you know one example but you know we could easily build this for node we could build this for iOS whatever platform you want but I felt like Android had you know Android has the biggest market share and in terms of mobile right now and also if Im talking about a personal assistant Im probably typing away on my phone Im not in a web app in a chat window Im likely on my phone so I thought Android would be a good way to start now I know that there is flutter and flutter allows you to build you know apps for both iOS and Android but so for this article Im going to start off with Android maybe Ill do flutter in the future requests that in the comment well see so back to the structure so Android uses the modelviewcontroller architecture and the activity is considered the controller in that step so we have several different activities that well use in our app and the way the Android activity lifecycle works is that whenever an activity starts a bunch of event listeners like on create on start on resume are waiting to be fired right and then they are fired at certain points in the life cycle and our goal is to put the logic of our code into these event listeners so for example in oncreate right when that activity starts we might want to say initialize our firebase object so that once the user logs in then were going to authenticate that user and send a request to the server to then store that users credentials for example or if they click a button then go to the next activity right so thats the Android lifecycle now the way this that you know this app could flow it could get very complicated writes and apps do get complicated you know a lot of these user flows go back and forth and in a circle and theyre not linear that you know they go in all different directions and it can get it gets more and more complicated but to start off were going to just work with three different user pages for our mobile app the first one is the login activity and so just think through this with me for a second theres not a lot of visuals for this next to you know minute but just think through this its a useful before we get started so heres how it works the user will log in theyll type in their username and their password right theyll click login whats gonna happen is that were going to take that text and were gonna send it to firebase firebase is the cloud service that acts as a database for us right so were gonna store that user ID and password and theyre off token in in firebase firebase will return back to us a token that says a user has successfully logged in well use that to make sure that the users session is running throughout the Android activity lifecycle now once a user has logged in we send that data to firebase the button login is clicked then well move on to the next page which is the payment activity inside of the payment activity were going to use plaids API code to authenticate a user with their bank account and luckily plaid has this amazing tool called link that shows all of those bank accounts already integrated and we just have to kind of copy and paste it into our code and with then we can integrate with those services now once a user has logged in with those services that includes the UI that UI you saw with those banks plaid did that and so once we have that were gonna get back a token from plaid that says right this person has authenticated with their bank we have their transaction data we have their bank data we can make purchases with that we can do whatever with that the user has given us permission well take that plaid token well save that to firebase as well right so now we have made two requests to firebase the first one was to authenticate the user and the second one was to save that plaid token so that we now know what this users bank credentials are at least a token and then we send that data to the next activity and in the next activity were going to show recall that visualization piechart were going to take that plaid transaction JSON data were gonna parse it with some JSON parser were going to display it for the user to see as a pie chart because its got those categories embedded for each of those transactions for the past month the past 30 days and then were going to send that transaction data to firebase to store that were then going to pull three tweets okay so were gonna pull three different mentions sets of mentions of both Apple Google and say Twitter you know all these different stocks or Apple Google Facebook whatever stuff we want to and once we have those stocks were gonna pull lets say a hundred of them each were going to perform sentiment analysis on your raise of tweets you know were gonna classify each of them has positive or negative and were gonna get some polarities for some overall score of how positive or how negative some sets of tweets are between 0 and 100 and then based on that score were gonna compare the scores and see which is the highest one and lets say Google is the highest one right that has the most sentiment for the day based on that we will then make a request with the alpaca API to make a purchase of the stock with the highest sentiment now were gonna take 4 of this persons budget and were going to invest 4 of that now 1 is for us and were gonna invest in alpacas API as well with that 1 and thats how we make money we take a 1 cut cut of a users monthly budget and we invest that using our own alpaca API key thats meant for us and our bit our bank account its its linked to that so thats the business model we take a 1 cut a users monthly budget and we invest that and thats thats thats thats how it works and lastly once weve done all of that in the budget activity we go to the main activity and inside of that we perform a synchronous pushing and pulling between the dialogue flow agents that we build in the cloud before I you know before I get started with coding one more thing you might be thinking well ok so every time a user logs in we are going to then make that investment shouldnt we do that at a set interval yes and the way to do that is to use whats called a cloud function on firebase that happened at some set interval now the word cloud function is actually a wrapper around the concept of whats called a cron job and this has been around in web development for decades or not decades a decade in the hat at least the idea is that some process runs serverside at some interval and it just continues to happen whatever at whatever interval we set and so we can make that investment serverside later on but you know for this example we want to just do this all in a way that we can see all the code in one platform all right so lets get started with coding we have a lot to do so the first step for us is to is to perform user authentication with firebase so lets get started with that so to start off I have this buildin AI startup repository that I had from a previous article that we can basically just reuse because it had that firebase functionality that was built in there and what we can do is we can just switch it up so that it works for our our code in this article so Ive downloaded that from that repository Im gonna open it up and look at it so alright lets get to this lets see whats in here wheres the main layout and lets see the design of it okay so this is our first login page this for the you know previous app but we can change all this right we can change the image we can chant you know we can delete the image whatever we want just like that you know remove it whatever but so thats the activity log in now right so lets go to login activity which is the activity associated with that view that we just saw right we just saw that view now inside of this login activity weve got a bunch of imports okay and so what we can do in like I said in the Android activity lifecycle a bunch of these event listeners are waiting to be fired so heres what happens so when a user sets up a login form okay were gonna get that from that textview theyre gonna get the password view and once we have both of those were going to say alright we have both the email and the password and now we need to make a request to firebase so let me do that okay so right in this progress spinner Park when the user has logged in Im gonna input the firebase code for logging in so Ill go to google firebase log in Android off and so Im doing this from scratch just to give you an idea of like how I would build this okay so heres the em off method so Ill put that right up here firebase em off no not up there we go all right before I do that need to implement need to add this dependency in the app builder cradle there we go all right and once we have that were going to authenticate the abyss snippet right here so weve already initialized this M auth object or get the instance of that and then Im gonna say create the user using this so its gonna take that email password and then its gonna say okay if its successful update it to create a firebase user and then update the UI so well just paste that right there so of course is gonna be read but once we implement our library that is it goes away all right so that is for firebase user login now database with firebase lets go to firebase for a second and lets get started with firebase now inside of firebase we can create a new app and inside of that app Ill say heres the name my project test project and I accept the rules what a great project alright great my new project is ready now I will say database what is my database create a database enable and this creates a database for me in firebase so Ive got my database right here Ive created it Ive got my storage you know any files that I upload will go here in terms of authentication I can set up a signin method so right now email password is disabled so I just have to enable it and Ill save that and great its enabled and I can add add users here manually with an email and pass or I could pass that in the my app and then its gonna show up here under authentication now cloud functions are really interesting because this is where serverside that those cron jobs I was talking about this is where they would go and we build those with JavaScript but right now were gonna not do that were gonna go back to our app so I did the first part user authentication with firebase and database with firebase now for Bank authentication with plaid so lets go to plaid check out the website what is plaid so plaid is the easiest way for users to connect their bank accounts to an app great I remember when they were just a very small startup in San Francisco good times theyve really grown since then and so has my buddy Brians coin based thing which we need to integrate by the way and so I wanted to mention this the this the bad thing about plaid is that its only u.s.

Watch Me Build a Finance Startup

bank accounts and were not trying to build something just for the you here we are trying to build something for the entire world and if we you know because if we dont do that someone else will so you have to from the start as Eric Schmidt CEO of Google said you have to from the start to build something for as many people as possible because if you dont that someone else will so dont try to build something for the luxury markets try to build something for the middleclass the common person and not just in one country but everywhere so even though plaid only works with US bank accounts at least it has a coin based integration so coin base then means that you can have you know people from different countries who use Bitcoin and cryptocurrency which is not you know only in the u.s.

Watch Me Build a Finance Startup

so thats our Gateway to the rest of the world so if you dont live in the US and you want to use this app for now you can use coin base to do so but we can definitely improve that and we can add different payment options this is just the easiest way to start for this prototype all right so once we go hit in here we can log in we can get our API keys lets go to Docs toe inside there Docs we can see a bunch of their different SDKs so it seems pretty easy theyve got this QuickStart right here for node which I tried it was super easy but you just download it and then run it and its gonna its gonna pull a bunch of transaction data very easily into your hate into an HTML page so what I did is I said plaid link Android and so that took me to this Android page so unfortunately Android is one of their least maintained repositories it was updated two years ago luckily it works so if we go into app and then we go into source main sample main activity so its all in here all of that code is in here lets lets look through it so what happens is we initialize a link to plaid right so this this is code that we need right here were gonna start copying this after I explain it but the first thing for us to do is to is for us to create a hash map and inside of this hash map we have all of that plaid you know authentication detail our public key the name of our app etc then we generate a link based off of that a URI that will then connect to clap to plaid you know via all of that so this is just appending all this data to a very long you are and so theres nothing you know specific to plaid here that we have to download were just creating a URL and so once weve created that URL well say okay were gonna create a new webview that will open up a web page an HTML web page and show the result of that link when we request that link right when we make a post request to it it will then initialize that and it will create a client and so inside of this callback itll say great if if the user has connected that means that there is a connected response in the JSON then show the public token that institution theyve connected to and then show all of that data as a JSON response and then well generate a link you know based off the based off of that but the point is that what we want is this public token right we want that public token to then save to firebase so if we just go over here and copy all of this so if initialize link will copy copy copy copy copy copy copy piece paste copypasta and theres also these two helper functions down here generate link initialization URL and this parse link URL code right here so well paste both of those in the previous app that I built for this boilerplate repository we integrated with PayPal however in this version of the app were going to integrate with plaid so in this payments activity which we already have we just have to you know redesign that and remove the PayPal button replace it with plaid whatever but remember that code that we just copied and pasted remember where was that code that code was in there in their web app it was inside of there on create so inside of on create were gonna do the same thing right here and well paste that in just like that and then well import the dependency for it and we also want to save that data to firebase right so once we have that token we want to save that that data right to the to the firebase user database and we can look in the firebase SDK and and there are code examples on ways to do that right saving data firebase no database Ill get an instance of the database and then Ill save that right so even if I have a user object I can say okay so based on this user rights um from the database once we have that database we pull that database object we can get the user objects and then we can say lets set these features of this user to you know different you know categories whatever we want and we can have one called token ID and then well say user ref got set value asynchronously what for that new token is so for our example that would be the firebase token okay so thats for Bank authentication with plaid and thats just gonna show up like we dont even need to we dont need to do anything for that and I can show you what that looks like right here inside of payments look at this right so Im gonna change all this you know obviously before the article comes out but some I you know payment details here my authentication details for plaid and then its got all this data right here which I just copied and pasted from their examples very good example but it creates that web view for us we dont have to code any of that and so once I you know compile that its gonna its gonna allow us to then be able to authenticate with plaid very fast user pass login and now it shows that payments activity and so this has nothing on there in terms of UI that we built ourselves this is really just showing directly from the plaid website from their API this its displaying this web food so all this has rendered you know on plaids end and then we can select any bank here you know whatever and its gonna make a custom login for that Bank which is awesome right just like that and then for the test API we just have to type in user good and then pass good and then acts as our test credential for plaid and its gonna its gonna load itself just like that send credentials hopefully authenticates authenticated boom pulls that data just like that awesome so now that we have that bank authentication with plaid now we want to perform that data visualization with any chart right so once we have that data lets take a look at what that what that what that data looks like so well go to any chart Android and well find out how that works but in the meantime let me make sure I have that string of transactions so Ill say link data dot yet transactions categories not just the transactions but the categories of those transactions and Ill store those categories in tab in string categories and once I have that Im gonna perform that Im gonna create that pie chart with any chart which will then display for the user so Im going to see like any chart pie chart Android example Google is our best friends ever great great great great great so I integrated with this so Ill put this in the build up Gradle and then I will come on come on where is it pie chart code snippet give me that gimme gimme gimme great there there it is so we first initialize that pie chart and then we add those values and then we say heres a title legend legend set the chart and thats thats going to display that and they did that in the oncreate and i said as well so we can do the same so heres a pie chart we had an onclicklistener if we like and well just set that right here but instead of whatever you know fake data they had will use list equals categories right and now we need to import the library so it doesnt break now on to step 6 configuring dialogue flow for conversation if we go to dialogue flow and Ive created you know several agents now so its so its been a pretty cool experience working with dialogue flow so once we go to dialogue flow you can see that Ive created three intense here so one intent is the budget one intent is the balance one intent is you know how much can this person afford so all sorts of questions related to can I afford X go under the afford intent all sorts of balance questions go under the balanced intent and all sorts of budget questions go on to under the budget intent and theres the investment intent as well which tells us the price of our stock data so in terms of balance so what happens here is I can create a bunch of training phrases like whats my balance how much money do I have whats in my bank account EO you know whatever variation we want and what its gonna do is its going to learn the you know the type of response based based on training off of these responses so the user doesnt exactly have to say these things for us to be able to trigger the response that we want but it has to be something related to this and thats the beauty of dialogue flow now how does it actually know our balance right so once we have our balance weve saved that data to firebase inside of the users database if we want to query firebase to get that data and how do we do that what we build was called a web hook so the idea is that we go to fulfillment our web service is going to receive a post request from dialog flow for some data so well create some web hook its going to then enabled right just like this its were gonna create some requests to our firebase service and luckily Google runs both of these things so its easy to integrate both and its gonna say heres you know welcome to my agent lets get this data from firebase from the firebase cloud function and then were gonna display that and so what happens is in under intent when we go to balance we go all the way down and then we say under fulfillment we say enable web web hook call for this intent and so thats gonna use a web hook well go back well go to fulfillment and then well say enable it and then well make the web hook so if we go back to firebase what it functions and then well create a web hook that will take data from our user database and then allow our dialog flow agent to make a post request and retrieve the balance data and all the transaction data and all of that Platt authenticated data that we pulled from the web once the user signed in we push it to firebase store it in the user database and our agent pulls that you know as per necessary whenever a user makes a request so its stored in the cloud so we can create several different firebase functions as as necessary I want to step 7 so for tension flow for sentiment analysis so what I did was I found this text CNN text convolutional neural network model right here that was trained on a bunch of movie review data on some yelp review data and the goal was to classify this data as either positive or negative and we can repurpose that data for tweets because text generally has similar sentiment whether its talking about movie reviews or whether its talking about stock prices right or company you know brands and so we can look at this model if wed like we can see how its built or we can use the pre trained version and not even have to worry about how the model is built I have several articles on how convolutional neural networks work search CNN Suraj also search text CNN Suraj for articles on CNNs applied to textual data but the idea is always similar vectorized input data pass it through a bunch of differentiable blocks we get an output and thats our classification in the case of classification so we train this notebook in collab and then we save it locally so I actually have the protobuf file right here saved model dot PB and then what we do is we integrate tensorflow lights into our Android app and then we take that protobuf file and we drag and drop it somewhere into will say our assets folder and then we can reference that very easily and well add it to drawable wherever and thats our saved model right there as the protobuf files so we train it in the cloud and then we move it to Android to make that inference request so what were going to do is were going to perform sentiment analysis on a bunch of twitter date on Twitter data and then were going to use how pack up for trading so what well do is well say Twitter Android example there we go so Twitter has this Twitter kit where we can which we can use to pull a bunch of tweets or in this example theyre only pulling one tweet but we can modify it so it can pull several from Twitter and so under payments once weve got those transactions that it uh weve displayed that and then were gonna say before we go to the next class that shows you know the agent and its gonna be red for now were gonna import these dependencies in a second well say get the tweet ID that has the phrase you know Apple apples and then well do the same for say Google and one other company like Twitter even or Facebook whatever and once we have all three of those were going to could make you know make this request three different times for each of them say you know one two three and then well load the tweets by their name tweet to tweet a t33 editor and then were going to get the results so into result theres old to result three and then were gonna store those results and so Ill go back and Ill do tensor flow inference with Android and what do I need to do here I need to initialize a tencent inference interface and then I need to say heres my model file heres the label file see how see how Im doing this off of the tutorial and then Im gonna say great so I want to create a function thats gonna use that inference to then make a prediction so Ill go down here for a separate function and its gonna take its not gonna be recognizing him is this gonna be recognized tweets and its gonna return not pixels its gonna return a string or you know or value or binary value and Ill take that input and then I will perform inference on it using that pretrained model and then its going to return a value its call result and so the name of this is called recognised tweets and Ill go back and Ill say okay so for each of these tweets recognize tweet and then load tweet success heres a result result 1 equals result and then Ill recognize tweet the result and then Ill say class right result 1 equals recognize tweet and Ill do the same for each of them Ill say result result just like that and then theres all theres all three and then thats the very end now I need to be using promises to make sure that this is happening asynchronously and when its all done then I make the prediction but Im just like hacking through this fast and so then we have three results and then see like if find greatest of three values see Im using Google here buying greatest of three values Android quickanddirty Stack Overflow max of three numbers in Java its probably one beautiful oneliner somewhere that it up in next up math there we go Thanks Java max topmast result one result two result three and thats the next value and I can you know save it as a key value pair so then you know what we have the max max value well see what the key is for that value I could instead save it as a hash map and then Ill go to the alpaca API example and Ill make a request using that so lets go to documentation for how pakka and is the last step so in their web api we use the key and we use the secret key to get the values if we go to Client SDK they have one for JavaScript and for Python nothing for Java unfortunately but thats okay how to code examples has these and then we go to order examples and so this makes a request if you want orders endpoints and so they have one for JavaScript but it looks very simple we just create an order with that symbol which we pulled right already we decided what that was using tensor flows inference service using sentiment analysis and now were going to make the trade with that you know how many do we want well well choose that based on the you know whatever budget weve allocated and well create the order and well do this not just one so well do it once for the user and then once for ourselves and obviously we need to notify the user that were taking one percent cut at the beginning but again this is a prototype so we do this twice so obviously we cannot paste JavaScript code into our Android app but if we do Android Ill pack up like that how pakka there we go and its using react great so markets main application and then we integrate that right there to make the request where we could just build it ourselves directly using the HTTP API and then using an HTTP library but once we do that we do that twice here and here and then we make sure that we import these libraries so its stopped being read and when were done we have our final solution and we can then pull that data display it using any chart and then chat with our agent its made that request it will perform sentiment analysis on all three of those stocks that we hardcoded and then it will choose a stock to invest in based on the one with the highest score that brings us to the last question how do we improve this app so in this article what I did was I made the request directly from the from the android client but ideally this is happening as a cron job or a cloud function in firebase at a repeated interval thats happened every day or every month I could give my agent more conversational ability so not just being able to tell you what your budget is and how much you have left to spend and what your how your investments are doing and whether or not you can afford something but also it could tell you you know what would be a good investment and it could you know its ability to make automated investments could improve with different technologies like deep reinforcement learning and we dont just use tweets we use newts new sites things like that we can also let a user modify their budget accordingly or right now what their budget is is basically what their budget was based on their spending from last month but we can create a dropdown and allow users to allocate their you know monthly budget as per necessary and then update that on the on the firebase backend and lastly of course we can design it you know better so in terms of the user interface so those are all the parts of this app the code is going to be in the github description I encourage you to make pull requests if you want to make this better I encourage you to build an AI startup I encourage you to use AI technology to make an impact in other peoples lives by building a profitable business that is the way to you know solve AI that is the way to use this technology to make your life better and other peoples lives better I hope you found this article useful and if you have an AI started by ideas share it in the comment section well all give you feedback on it please subscribe for more programming articles and for now Im gonna fly to Spain thanks for watchingp

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *