Friday, May 31, 2024

Do AI chat bots learn from user interaction?

 This is an important question going forward with AI. If they do then information from one questions to the next and the answers get somehow sent to AI's source. If not, there is nothing going from your device to the source. I do AI chats both on my Android Samsung phone as well as from my Surface Pro laptop. The META AI is on my on my phone.

CoPilot

CoPilot does not remember stuff from one conversation to next. It does not LEARN from user interaction.


META AI

Look here, what I hear from META AI on my WhatsApp account:

Do you learn from user interaction in any way?

Yes, I learn from user interaction in several ways:

1. *Improving responses*: Through user feedback, I can refine my understanding of what constitutes a helpful and accurate response.
2. *Adapting to language*: User interactions help me learn to recognize and generate language patterns, idioms, and colloquialisms.
3. *Expanding knowledge*: Users may ask questions or provide information on topics I'm not familiar with, which helps me expand my knowledge base.
4. *Tuning accuracy*: User corrections and clarifications enable me to fine-tune my understanding and accuracy on specific topics.
5. *Understanding context*: User interactions help me better understand the context and nuances of language, allowing me to provide more relevant and empathetic responses.

Your interactions with me today are contributing to my ongoing learning and improvement!

The Q&A are indeed saved on the server.


GEMINI

Here is what I hear from Gemini:

Do you profit from user interaction in some way by saving the Q &A?

Yes, Google Assistant can benefit from user interaction by saving Q&A data. This data helps improve its understanding of language and user needs. Here are some ways this can happen:

 * Improved responses: By analyzing past interactions, Google Assistant can learn to identify patterns and improve its ability to respond to future queries in a more informative and helpful way.

 * New feature development: Data on user interactions can inform the development of new features and functionalities for Google Assistant.

 * Personalized experiences: User interaction data can be used to personalize the Assistant's responses to individual users, tailoring results to their preferences and search history.

This interactive learning is very important and I am not sure how and how often the creator of CoPilot updates its KB.


Friday, May 17, 2024

How do you launch Python assuming it is installed?

Python from python.org and many other software programs installs python and they may choose to install in different folders or locations. Finding where it is installed is important. If you need to run python on a command prompt, the python executable should be in the environment's path. You may note that you may have multiple versions of Python installed on your computer for varying requirements. You should know what version is installed and where.

In this post you will get to know ways and means to find the python executable on your computer.

1. This is the easiest. You try to check for Python using your command prompt as shown. If you get the following reply:

This only means the python.exe is not in the path C:\

============================================

C:\>python -c Print 'Hello'

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

============================================

If you find a python in the directory, it may be a short cut, if a file existed.

If I run without arguments as shown above, I am taken to the Windows Store to download Python 3.12 as shown.


I already have Python 3.12 installed when I installed PyCharm. 

You can check if the executable python is in the environment's path as shown:

========================

C:\Users\hoden>path

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\hoden\AppData\Local\Programs\Python\Launcher\;C:\Users\hoden\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\PyCharm Community Edition 2023.3.3\bin;

========================

The executable is in the JetBrains directory that was installed for PyCharm as shown.

2. There is another way to find where python is installed.


Run the following command at command prompt:

======================================

C:\>where python

C:\Users\hoden\AppData\Local\Microsoft\WindowsApps\python

C:\Users\hoden\AppData\Local\Microsoft\WindowsApps\python.exe

========================================

In this folder,

C:\Users\hoden\AppData\Local\Microsoft\WindowsApps

You find two other python executables as well, python and python3. These are in the environment's PATH as well.

Here is the properties pages of one of them,


As you can see this is an empty file. There are several reasons why this file exists here. It is more like a placeholder or a shortcut for a non existent file and sometimes open a link in the web browser for a download location (Windows Store) as we saw earlier.

3. This yet another way. Windows Powershell is a powerful program that can also be used.There are two ways of starting Powershell, as a command line program or an interactive way.

You could also use Windows Powershell as shown:

===============================

PS C:\Users\hoden> Get-Command python


CommandType     Name                                               Version    Source                                                             

-----------     ----                                               -------    ------                                                             

Application     python.exe                                         0.0.0.0    C:\Users\hoden\AppData\Local\Microsoft\WindowsApps\python.exe  

===================================================

This is similar what we saw earlier. It showed the same file we saw earlier.

3. The following is not run in PowerShell but on the C:\ prompt.

However, if you have multiple versions of python installed you can try this:

==========================================

C:\Windows\System32>py -0

 -V:3.12 *        Python 3.12 (64-bit)

===========================================

This does not show the path but flags the version. if you want both path and version try this:

================================

C:\Users\hoden>py --list-paths

 -V:3.12 *        C:\Users\hoden\AppData\Local\Programs\Python\Python312\python.exe

================================

You can check this here:

=============

 Directory of C:\Users\hoden\AppData\Local\Programs\Python\Python312


05/05/2024  05:33 PM    <DIR>          .

05/05/2024  05:32 PM    <DIR>          ..

05/05/2024  05:32 PM    <DIR>          DLLs

05/05/2024  05:32 PM    <DIR>          Doc

05/05/2024  05:32 PM    <DIR>          include

05/05/2024  05:32 PM    <DIR>          Lib

05/05/2024  05:32 PM    <DIR>          libs

10/02/2023  01:27 PM            36,874 LICENSE.txt

10/02/2023  01:28 PM         1,664,545 NEWS.txt

10/02/2023  01:27 PM           103,192 python.exe

10/02/2023  01:27 PM            68,376 python3.dll

10/02/2023  01:27 PM         6,972,184 python312.dll

10/02/2023  01:27 PM           101,656 pythonw.exe

05/05/2024  05:33 PM    <DIR>          Scripts

05/05/2024  05:32 PM    <DIR>          tcl

10/02/2023  01:27 PM           109,392 vcruntime140.dll

10/02/2023  01:27 PM            49,520 vcruntime140_1.dll

               8 File(s)      9,105,739 bytes

               9 Dir(s)  102,834,245,632 bytes free

===================================================================

There is also a executable pythonw.exe in the above folder. It will give no response should you click on it. It is supposed to work with a python GUI. If you need to use this you will have to use the other system files in the System.IO.

Finally, when we installed PyCharm from the JetBrains site, we created this directory. We also chose to include this in the PATH as shown.

C:\Program Files\JetBrains\PyCharm Community Edition 2023.3.3\bin;

What do we have in this directory?
The BIN folder has two Applications pycharm64 and jetbrains_client64. The jetbrains_client64.exe connects you to an external server if there is one installed. It is a thin client.

However, clicking python64.exe in the installation folder opens up the GUI of PyCharm as shown.


We will be using this for exploring the image recognition programs. Also, JetBrains created a shortcut for this executable on the desktop.




Friday, May 10, 2024

How do you create a 'Hello World' program using PyCharm?

 "Hello World" is a popular program sued in the introduction of many software programs made popular by Microsoft. Bern Kernighan of the Bell Laboratories used (1972) it in the documentation of BCPL when the language C was developed. It has been repeated for many languages.

Before we do this in the PyCharm, it is important to look at the PyCharm interface in some detail. The PyCharm IDE interface is just like other interfaces like Visual Studio IDE. That said, here are some major parts of this interface.

When you start the IDE interface, the first screen you encounter is the Welcome Screen shown here. In this screen, you have access to take a quick tour if you desire to do so.



The navigation pane on the left gives you access to the Projects, Customization, Plugins, and learning tools.

If you have already created a project, you could Open it, create a new one, or get one from the version control system as shown in the above image.

Since this the first time using this interface. Click to create a New Project. This is a Python IDE and therefore it uses Pure Python whose version is 3.12. Django is another option we will not be using now.

The default Project Name is python Project. Overwrite this and provide the name Helloworld as shown. Leave the location as is. Do not click to Create Git Repository. Place check park for Create a main.py welcome script as shown. Note that the project will be created in the C:\ drive at the location, C:\Users\hoden\PyCharm Projects\HelloWorld. The IDE also creates a virtual environment at the location shown on this screen. We will visit virtual environments later.

Now, click Create at the bottom. The program starts running and takes a minute or so and you will see the screen shown here displayed. The Helloworld main program is created. main.py is python file created and the main.py script is shown on the right.

The project is ready to run. If you run the code on the right by clicking the green button shown in the above image. You will immediately see the result of running at the bottom as shown below. The program prints the words, "Hi, PyCharm".

What if you want it to print, Hello World".? Go back to the project screen as shown. Now, overwrite PyCharm in the bottom of the main.py's code window shown.

Now, hit the green button again. You will see, "Hi, Hello World" as shown.

==============

C:\Users\hoden\PycharmProjects\Helloworld\.venv\Scripts\python.exe C:\Users\hoden\PycharmProjects\Helloworld\main.py 

Hi, Hello World

Process finished with exit code 0

=====================

Where did the Hi come from?

Think how you can change this.