• @Tartarosso
    link
    11 year ago

    La domanda che mi pongo, quando vedo del codice di chatgpt è: quanto è affidabile? Finché gli chiedo di simulare un lancio a 6 facce nessun problema. Ma se gli chiedo: fai il matching fra gli elementi di queste due liste ma solo di quelli che hanno una differenza del campo orario di meno di 10 minuti. Elimina poi dalla lista quelle accoppiate ecc. Ecc. E magari pure qualcosa di più articolato. Come faccio a sapere che il risultato è corretto e non ci sono casi particolari non individuati? A quel punto se trovo un errore devo provare a farglielo correggere. Oppure correggerlo io. Ma in questo ultimo caso devo fare reverse engineering del codice. Quindi se ho le conoscenze per scrivere quel codice complesso meglio che me lo scriva da solo. Se non ho le conoscenze per scriverlo non sarò in grado di correggerlo.

    Non dico le IA e le LMM siano inutili per programmare ma al momento le vedo prone a far commettere parecchi errori ai programmatori meno esperti. Opinioni? Esperienze diverse?

    • suokoOPM
      link
      fedilink
      21 year ago

      Per il momento, a quanto ho visto, viene usato per lo più per generare snippet di codice da modificare poi secondo le necessità, ma questo esempio fa pensare a una possibile evoluzione. Chatgpt potrebbe riuscire a collegare tutti gli esempi di codice presenti sui vari repo git pubblici e offrire dei wizard basandosi sulla tua richiesta iniziale.

            • suokoOPM
              link
              fedilink
              21 year ago

              Il bardo sembra sicuro di se! Sure, I can do that.

              Here are the steps on how to determine if all car trips of a user could have been done with an electric vehicle:

              1. Go to the GitHub repository linked above and download the code.
              2. Extract the downloaded zip file.
              3. Open the google_location_history_total_distance_travelled.py file in a text editor.
              4. In the main() function, add the following lines of code:
              # Import the necessary libraries.
              import geopandas as gpd
              import requests
              
              # Get the user's Google Maps location history.
              location_history = requests.get('https://www.googleapis.com/location/v1/locations?key=YOUR_API_KEY').json()
              
              # Create a GeoDataFrame of the user's location history.
              gdf = gpd.GeoDataFrame(location_history['locations'])
              
              # Get the distance of each trip in the user's location history.
              distances = gdf.geometry.length.values
              
              # Get the charging points near each trip in the user's location history.
              charging_points = requests.get('https://api.openchargemap.org/v3/poi?country=US&q={}&radius=10000&operators=all&types=all&access=all&sort=distance&page=1&page_size=100'.format(','.join(gdf.geometry.centroid.values))).json()
              
              # Determine if each trip in the user's location history could have been done with an electric vehicle.
              for i, distance in enumerate(distances):
                  # Get the charging points within 10 kilometers of the i-th trip.
                  charging_points_near_trip = charging_points['results'][charging_points['results'].distance < 10000]
              
                  # If there are enough charging points near the i-th trip, then the i-th trip could have been done with an electric vehicle.
                  if len(charging_points_near_trip) >= distance / 100:
                      print('The {}-th trip could have been done with an electric vehicle.'.format(i + 1))
                  else:
                      print('The {}-th trip could not have been done with an electric vehicle.'.format(i + 1))
              
              1. Run the code.

              The output of the code will be a list of messages indicating whether each trip in the user’s location history could have been done with an electric vehicle. For example, the output might look like this:

              The 1-th trip could have been done with an electric vehicle.
              The 2-th trip could have been done with an electric vehicle.
              The 3-th trip could not have been done with an electric vehicle.
              The 4-th trip could not have been done with an electric vehicle.
              

              This means that the first two trips in the user’s location history could have been done with an electric vehicle, but the third and fourth trips could not have been done with an electric vehicle.