I am implementing a social networking App Backend and I am using Node.js for development but in my app one feature is feed like in Instagram following and explore feed.
I have implemented backend in node js but for a feed algorithm I use python so how to integrate python function into node and also I want to know is it a good approach to in one single application you use two different languages.I use python because in future we use some machine learning so we all know no language is better than python for machine learning.
Please explain to me what is the right way to do it
Related
I am planning to create a ml model the recognizes some stuff in real time video, it will be a deep learning model, What I would like to know is how could I apply that model into my web app and what should I use? I want to use the cam of the computer and the model to recognize some patterns.
I did not made anything yet but I am plannig the project. any ideas is appreciated. I know streamlit and gradio, but i would like to use node, any framework like react or django, flask etc. any idea is appreciated. thanks
The answers will vary depending on the details of the project. For example if you want build basic project, you can use basic html, css and javascript for Frontend but if you need state management between the pages, you can use React.
You can use FastAPI or Flask for accessing model prediction and send to Frontend, you can search like this "Deploy Machine Learning Model using Flask" on the Internet. If you want to access webcam you can use VideoCapture in OpenCV.
Learn A JavaScript framework!
A JavaScript framework is a pre-written code library that provides a structured solution to a common problem. It helps developers to create dynamic and interactive web applications by providing pre-built code, tools, and utilities. Frameworks often follow a specific architecture and design pattern that promotes code organization, modularity, and reusability.
Some popular JavaScript frameworks include Angular, React.js, Vue.js, and many more. These frameworks provide a range of features such as component-based architecture, declarative programming, state management, and data binding, which can help developers to build complex applications more efficiently and effectively.
Using a JavaScript framework can help developers to save time and effort by abstracting away some of the underlying complexities of building web applications. However, learning a framework requires a certain level of expertise and knowledge of JavaScript, and it's important to choose the right framework for the specific requirements of your project.
I am a beginner in Moodle and I wrote an algorithm in python to learn users profiles. The aim is to create a plugin that provides adaptive functionalities in the Moodle platform based on users' profiles. However Moodle documentation is too large, which makes me confused and I can't find a way to start creating the plugin. There's too much information and no good tutorials for beginners. So what I want to know is:
Are there any good tutorials that I can't find?
How should I begin? Do I absolutely use git?
How should I choose the right plugin type? Is it OK with Machine learning backend plugins, since my algorithm belongs to machine learning area?
Any answer or information would be very helpful!
Ok. Let's see...
The aim is to create a plugin that provides adaptive functionalities in the Moodle platform based on users' profiles. [...] How should I choose the right plugin type? Is it OK with Machine learning backend plugins, since my algorithm belongs to machine learning area?
Moodle is highly modular, meaning that the machine learning/data analytics-related functionality may well fit within a machine learning backend plugin (a python backend is supported), but all the modifications to the platform will probably need separated plugins, depending on the precise character of those "adaptive functionalities".
If you need non-documented extra advice or info about the machine learning backend or, later on, about the specific plugins you may need to write for the "adaptive functionalities", you may ask in the Moodle developers forum (https://moodle.org/mod/forum/view.php?id=55) and/or join the Moodle Dev Chat in Telegram and ask around (https://t.me/moodledev)
I can't find a way to start creating the plugin. There's too much information and no good tutorials for beginners. [...] Are there any good tutorials that I can't find?
It's very important that you decide first what exactly are those "adaptive functionalities" about, because depending on them you may need to do one kind of plugin or another, and different plugins are made slightly differently (sometimes very very differently). This is the list of plugin types: https://docs.moodle.org/dev/Plugin_types .
The best way to kick start any kind of plugin development is to install the plugin https://moodle.org/plugins/tool_pluginskel in you local Moodle instance and generate the boilerplate code for your plugin, then start working from there.
About tutorials... the most updated source of dev info is the documentation, but there are some books about general development in Moodle (you may find them in Amazon, Leanpub...). Keep in mind that these books are usually not up to date, so compare their contents with the latest published Moodle version and having in mind the kind of plugin you are after before buying.
Do I absolutely use git?
If you plan to publish your code as a plugin or set of plugins then yes, you will need to publish it in a public repository and then follow the usual plugin review/publication process. Here is the doc about the process: https://docs.moodle.org/dev/Plugin_validation and here the doc about setting up the Travis automated validation tests for a plugin (this is easier than it sounds) https://docs.moodle.org/dev/Travis_integration#Moodle_plugins
Let us assume that, I have a Machine Learning model which uses the Tensorflow library and performs a function.
And of course, the function requires input and provides some output. Which can be easily done on my terminal.
Here comes the area where I need help, IO in the terminal is not what I wanted, I want to create a web application that has multiple functionalities. Let us only consider the area where my ML model has to work, say when I click a button after entering the inputs it runs the ML model back and provides me an output which I could display it on my web application.
I can develop websites with NodeJs. Is there any possibility of integrating the ML model with my web application made of NodeJs?
I tried running on some packages like child-process,python-shell nothing works, it gives me an error when it comes to the place of importing packages.
Please give me suggestions on the Integration of the ML model with a NodeJS web application using MongoDB as a database. All I wanted is that my web application runs my ML model wherever necessary to obtain the results which I can display through my web applications.
Also, provide information about technologies that can be easily integrated with the Machine learning model.
I'm also encountering similar problems.
Further to the previous reply, I would go for the micro services architecture design.
E.g. Use a node.js app to serve the front-end request, and the Python server only to serve the machine learning tasks.
You need to build a python web application around your model to serve responses (your model’s output) to the client (the webpage your nodejs app is serving).
Flask and Django are the major players there. REST is the most popular meta-framework.
Once you’ve built a REST API around your model, you just query it like any resource via HTTP/xmlhttprequest in JavaScript from your web page.
Or you can try to pickle your model and load into into JavaScript to query from your nodejs app.
Easier than either of those would be to use IBM Cloud Functions or AWS Lambda to expose your script/model. Very easy and cost effective.
I'm a fan of using the right tool for the job.
At my company, the data analysts (incl myself) primarily use Python because of the powerful scientific libraries; the web people downstairs use Ruby on Rails for building our own HR management webapp as well as maintaining our online presence.
We would like to have the two teams working a little closer together allowing the development of scientific webapps but are unsure about how to proceed.
We have significant investment in both technologies with a substantial codebase that we would need to continue to use.
Are there any suggestions about the best way to integrate the two domains of scientific programming and web apps using the two separate languages?
In lieu of substantially hacking apart either codebase to fit the other, I would first propose you evaluate an SOA solution.
e.g. create an API interface to your Python system, and have
the Rails app call that API for what the HR and public-site systems
require.
I assume that the Python part is a stack of back-end libraries/modules of scientific functions while the Ruby-on-Rail part is mostly as front-end. Then an relatively simple solution would be wrap those Python modules/libraries into services and let the Ruby-on-Rail-built front-end functions call those services.
To build the Python services, you can use xmlrpc for simple implementation, or some sophisticated framework such as twisted for larger scale implementation. You can also created only one portal service that hosts all your Python modules/libraries, that would basically give you an application server that handles all the requests form the Ruby-on-Rails front-end. Using which strategy depends on the scale and complexity of your Python libraries/modules.
I would like to design a web based game preferably in Python ( using Django maybe) though I'm open to any language other than Java/Flash/ActionScript. The idea I have in mind is more about data models than graphics and will leverage social networking sites. I would like to extend it with a mobile web interface in the future. Please give your invaluable suggestions and recommend some resources with which I can get started.
Step 1. Design a good game.
Step 2. Be sure that it fits the HTTP model of simple request/reply GET/POST processing. Be sure that the game is still good. Some people try to do "real time" or "push" or other things that don't fit the model well and require lots of sophisticated GUI on the desktop.
Step 3. Find a web framework. Django is okay. Others are good too.
Learn the web framework. Don't start with your game. Start with the tutorials.
Step 4. Rethink your game. Be sure that it fits the framework's model, as well as the HTTP model. Be sure that the game is still good. In particular, if your focus is "more about data models than graphics" then you have to really be sure that your game's data model fits your framework's capabilities.
Step 5. Rethink your framework. Is Django still the right choice? Perhaps you need to go back to step 3 and learn another framework. There's nothing wrong with learning a second framework. Indeed, until you learn another framework, you won't fully get Django.
Step 6. Now you should have enough background to actually implement your game.
If you are considering using Django as your framework, here are just some basic points about it you might find helpful to consider:
Firstly, the Django libraries are written in Python. Therefore, at least a basic knowledge of python is required to develop a site using Django.
Secondly, Django includes its own template system that is useful for integrating with html - http://docs.djangoproject.com/en/dev/topics/templates/ .
Thridly, as you've stated that you are more concerned with data models (which I am assuming means you are going to want to store information in some way especially considering it is related to social networking ?) Django also provides for a way to integrate with databases like MySQL and SQLite and the tutorial even walks you through how to set one up if you haven't already - http://www.djangobook.com/en/2.0/chapter05/ - and how to integrate with a legacy database if you have - http://docs.djangoproject.com/en/dev/howto/legacy-databases/?from=olddocs .
Lastly, Django enables you to run your site off of their development server which can be really useful for testing and running your site locally before deploying it to the web via Apache or another web server of your choosing - http://docs.djangoproject.com/en/dev/intro/tutorial01/#the-development-server .
I would really encourage you to do the online tutorial - http://docs.djangoproject.com/en/dev/intro/ - or take a look at Holovaty and Moss's "The Definitive Guide To Django" (available on http://www.djangobook.com/).
Hope this helps!