Retrieval Augmented Generation (RAG) with Google Gemma From HuggingFace Programming Computer Science by usmanmalik57 In a previous article, I explained [how to fine-tune Google's Gemma model for text classification](https://www.daniweb.com/programming/computer-science/tutorials/541544/fine-tuning-google-gemma-model-for-text-classification-in-python). In this article, I will explain how you can improve performance of a pretrained large language model (LLM) using … Claude 3 Opus Vs. Google Gemini Vs. GPT-4 for Zero-Shot Text Classification Programming Computer Science by usmanmalik57 On March 4, 2024, [Anthropic](https://www.anthropic.com/) launched the [Claude 3 family of large language models](https://www.anthropic.com/news/claude-3-family). Anthropic claimed that its Claude 3 Opus model outperforms GPT-4 on various benchmarks. Intrigued by Anthropic's claim, I performed a simple test to compare the performances of Claude … Odoo : report creation from JSON data Programming Web Development by codewasher Hi, I am new to Odoo ERP development. I have a requirement as below. I need to connect to an external API and get the response JSON data. From this response, I need to prepare the reports and show it as the list, then click on each item, it will show the report in form view. 1. I have JSON data 2. JSON data has student details, so I need a… Converting PDF Image to CSV Using Multimodal Google Gemini Pro Programming Computer Science by usmanmalik57 In this article, you will learn to use [Google Gemini Pro](https://blog.google/technology/ai/google-gemini-ai/), a state-of-the-art multimodal generative model, to extract information from PDF and convert it to CSV files. You will use a simple text prompt to tell Google Gemini Pro about the information you want to extract. This is a valuable skill … I need help with Twitter API v1.1 Programming Web Development by FarrisFahad I am trying to create my first successful API request. I want to post on my twitter account. I have created the developer account and generated consumer key and secret as well as access token and secret. I have also obtained the bearer token. I want to post on Twitter using the 1.1 version API. I want to do it with no framework or library. … Comparing Google Gemini Pro with OpenAI GPT-4 for Zero-Shot Classification Programming Computer Science by usmanmalik57 In this article, we will compare two state-of-the-art large language models for zero-shot text classification: [Google Gemini Pro](https://deepmind.google/technologies/gemini/#introduction) and [OpenAI GPT-4](https://openai.com/research/gpt-4). Zero-shot text classification is a task where a model is trained on a set of labeled examples but can … Re: I need help with Twitter API v1.1 Programming Web Development by FarrisFahad I am trying this but it returns an error ... $api_endpoint = "https://api.twitter.com/2/tweets"; $authorization = "Authorization: Bearer {$settings['bearer_token']}"; $text = 'Hello World'; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/… PDF Image Table Extractor Web App with Google Gemini Pro and Streamlit Programming Computer Science by usmanmalik57 In my previous article, I explained [how to convert PDF image to CSV using Multimodal Google Gemini Pro](https://www.daniweb.com/programming/computer-science/tutorials/541365/converting-pdf-image-to-csv-using-multimodal-google-gemini-pro). To do so, I wrote a Python script that passes text command to [Google Gemino Pro](https://blog.google/… Re: I need help with Twitter API v1.1 Programming Web Development by pritaeas https://developer.twitter.com/en/docs/twitter-api/getting-started/make-your-first-request You Authorization header is wrong, please reread the documentation. It should look like this: `Authorization: BEARER <your_bearer_token>` Re: I need help with Twitter API v1.1 Programming Web Development by Dani It seems as if you have to use OAuth to authenticate on behalf of your user (or whomever you want your application to post tweets on the behalf of). How did you generate the authorization bearer_token? It seems as if that's just a token to authenticate on behalf of your app, *not* on behalf of an end-user of your app/Twitter, which is what you need… Re: I need help with Twitter API v1.1 Programming Web Development by Dani Here's a document on how to use OAuth 1.0a: https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens That's what you need. Re: I need help with Twitter API v1.1 Programming Web Development by Dani OK, so I have some more time right now to explain in greater detail. When you post a tweet, you're app is basically acting on behalf of an end-user. Twitter, or X, or whatever they call themselves now, needs your end-user to go through the process of authenticating and then authorizing your app to tweet on their behalf ... kinda like Sign In with … Re: mysql base64 decoding? Programming Databases by cored0mp Everything is moving along, thanks for all the help so far! retrieve data from json object Programming Web Development by An … if there is a bug after passing json_encode $rev[]=intval($info['bIRevNum']); $name[]=$info…name,'rev'=>$rev); } // json encode echo json_encode($my_arr); // close connection mysqli_close($connection); ?>… i get a hyphen at the beginning of the json response php Programming Web Development by Abubaker_3 … code - 200 OK http_response_code(200); // make it json format echo json_encode( array( "responseCode"=>"", "responseStatus"… Re: PHP returning JSON Programming Web Development by cereal Have you tried json_encode()? [url]http://php.net/manual/en/function.json-encode.php[/url] But I'm afraid you have to loop anyway. Re: how to convert php array to json array Programming Web Development by pritaeas http://php.net/manual/en/function.json-encode.php Re: java.lang.StringIndexOutOfBoundsException Programming Mobile Development by RDSchaefer Well, I don't know JSON but I do know SQL. Are you sure the json_encode() function is the one you want to use? [url]http://php.net/manual/en/function.json-encode.php[/url] Log in stoped working Programming Databases by Gloak … line 0 [08-Jan-2014 11:05:55] PHP Warning: json_encode() [<a href='function.json-encode'>function.json-encode… Android WebView - Login Form Problem Programming Mobile Development by Macko888 Hi I am currently developing a mobile / tablet application and i've run into a stump. I have a webview that loads a form from a website that i have no control over, this website utilises the django platform. So the situation is this: The form on the foreign website uses ajax to send through a JSON encode string and returns a JSON object. - … Re: Passing a PHP array within a URL Programming Web Development by diafol Why don't you pass the info via POST instead of GET? Else, you could json encode array values in js and decode them in your 'waiting' php file. Have a look at prototype or jQuery libraries - takes the sting out of ajax. Re: Passing a PHP array within a URL Programming Web Development by jamey8420 [QUOTE=ardav;1154908]Why don't you pass the info via POST instead of GET? Else, you could json encode array values in js and decode them in your 'waiting' php file. Have a look at prototype or jQuery libraries - takes the sting out of ajax.[/QUOTE] Yes, I changed my methodology to use POST and that worked perfectly for what I needed. … Re: Read text file Programming Web Development by cereal … save the array to the text files: file_put_contents('questions.txt', json_encode($questions)); Then use `file_get_contents()` to get the arrays from the… files and use `array_combine()` to match them. As suggestion use `json_encode()` to save data to txt files, and then just run… Re: Inserting dynamic values into Javascript variables Programming Web Development by digital-ether > Hi there, > > I've been using PHP and MySql for some time now but I am quite new to Javascript. > I would like to know how it is possible to insert data stored in a MySql database into Javascript code. > For exmple, I am working on a travel guide site and would like to have a Google map for each location that is featured. I want … Re: Getting session-variables to PHP from JavaScript Programming Web Development by Airshow …[/URL]). PHP and javascript both support JSON allowing you to json_encode server-side and json_decode client-side. Server-side: Simply use…://www.php.net/manual/en/function.json-encode.php"]json_encode()[/URL]. Client-side: Whereas json is native in some browsers… Re: problem loading XML file using XMLHttpRequest Programming Web Development by Airshow … as is [URL="http://www.openjs.com/scripts/data/json_encode.php"]this[/URL]. I trust your supper went down… Re: Use input value as an array variable Programming Web Development by cereal Hi, to hide an input field use `type="hidden"`: <input type="hidden" name="from[]"> Now, `$_POST['from']` will be an array, if value is not assigned, then it will be an empty array, for example: Array ( [origin] => Array ( [0] => )… Re: Multiple Select Boxes and AJAX Programming Web Development by Airshow I'm not too sure why you are having a problem but it may be solved with JSON, which allows you to bundle up multiple data items (four lists in your case), and return them in a single ajax response. JSON is made simple for aplication programmers by the availability of JSON encode/decode functions both server-side (eg. php) and client-side (… Re: How to store value permanently in an array using php Programming Web Development by broj1 You can save values in a txt file, JSON format would be a good one. You can use [json_encode](http://php.net/manual/en/function.json-encode.php) and [json_decode](http://www.php.net/manual/en/function.json-decode.php) functions. Instead of JSON you can just serialize data into a txt file. Re: Graph maker in PHP Programming Web Development by gabrielcastillo …("SELECT * FROM users"); while($res = mysql_fetch_assoc($q)){ $data = json_encode($res); } return $data; } $data = get_chart_data(); echo $data;