Skip to content

Commit b373189

Browse files
committed
readme cleanup
1 parent cd88695 commit b373189

File tree

2 files changed

+59
-35
lines changed

2 files changed

+59
-35
lines changed

text-analysis-and-translation/README.md

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,7 @@ Couple of changes that you would need to make in this code, replace your web cre
252252
END;
253253

254254

255-
You can download this source from [my GitHub location][13]
256-
257-
258-
[13]: https://github.com/madhusudhanrao-ppm/code-assets/blob/main/AI-for-Financial-Services/langai.sql
255+
You can download [the source here](langai.sql)
259256

260257
Now we are all set to translate our text content by running the page. click on **run** green button.
261258

@@ -328,40 +325,9 @@ Running the APEX page
328325

329326
**Solution** : Please ensure that the web credentials supplied is correct.
330327

331-
### Demo video
332-
333-
Thanks for reading, liking, sharing, reposting - have a great day.
334-
335-
Regards [Madhusudhan Rao][19]
336-
337-
338-
[19]: https://www.linkedin.com/in/madhusudhanraobm/
339328

340329
References:[_AI for Healthcare_][20] and [_AI for Healthcare_][21]
341330

342331

343332
[20]: https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/tools/oci-cli/3.37.6/oci_cli_docs/cmdref/ai/language/batch-language-translation.html
344333
[21]: https://docs.oracle.com/en-us/iaas/api/#/en/language/20221001/
345-
346-
Links to my other related articles and LiveLabs
347-
348-
- [How to build intelligent applications using Oracle Generative AI and Oracle APEX][22]
349-
- [How to Translate text using OCI AI Language and Oracle APEX][23]
350-
- [How to use Oracle Select AI with Cohere or OpenAI to Generate SQLs from Natural Language][24]
351-
- [Retrieval Augmented Generation (Database Chatbots)][25]
352-
- [How to create dynamic websites on an always-free Oracle Cloud Instance][26]
353-
- [Working with Oracle APEX and Oracle Analytics Cloud platform][27]
354-
- [Working with JSON-Relational Duality Views and Oracle APEX][28]
355-
- [How to Integrate Google Cloud YouTube APIs with Oracle APEX][29]
356-
- [AI for Healthcare][30]
357-
358-
359-
[22]: https://www.linkedin.com/pulse/how-build-intelligent-apps-oracle-generative-ai-apex-madhusudhan-rao-z423f/
360-
[23]: https://www.linkedin.com/pulse/how-translate-text-using-oci-ai-language-oracle-apex-madhusudhan-rao-seq0f
361-
[24]: https://www.linkedin.com/pulse/how-use-oracle-select-ai-cohere-openai-generate-sqls-from-rao-zabjf
362-
[25]: https://www.linkedin.com/pulse/retrieval-augmented-generation-chatbots-aimlnlp-based-madhusudhan-rao-pgodf
363-
[26]: https://www.linkedin.com/pulse/how-create-enterprise-grade-dynamic-website-always-free-rao-9hgmf/
364-
[27]: https://www.linkedin.com/pulse/working-oracle-apex-analytics-platform-madhusudhan-rao-tfwvf
365-
[28]: https://www.linkedin.com/pulse/working-json-relational-duality-views-oracle-apex-madhusudhan-rao-a2izf
366-
[29]: https://www.linkedin.com/pulse/how-integrate-google-cloud-youtube-apis-oracle-apex-madhusudhan-rao
367-
[30]: https://bit.ly/O_AI_healthcare
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
declare
2+
3+
l_rest_url VARCHAR2(4000) := 'https://language.aiservice.us-phoenix-1.oci.oraclecloud.com/20221001/actions/batchLanguageTranslation';
4+
l_web_cred CONSTANT VARCHAR2(50) := 'Your Web Cred';
5+
l_input varchar2(4000) := :P87_INPUT;
6+
l_target_lang varchar2(20) := :P87_TRG_LANG;
7+
l_src_lang varchar2(10);
8+
l_response_json CLOB;
9+
l_text varchar2(4000);
10+
l_body varchar2(1000) :='{
11+
12+
"documents": [ {
13+
"key": "1x",
14+
"text": "'||l_input||'",
15+
"languageCode": "auto"
16+
} ],
17+
"targetLanguageCode": "'||l_target_lang||'" ,
18+
"compartmentId": "ocid1.compartment.oc1..YourCompartmentId"
19+
20+
}';
21+
22+
CURSOR C1 IS
23+
SELECT jt.*
24+
FROM JSON_TABLE(l_response_json, '$'
25+
COLUMNS (
26+
text VARCHAR2(4000)
27+
PATH '$.documents[0].translatedText',
28+
src_lang VARCHAR2(20)
29+
PATH '$.documents[0].sourceLanguageCode',
30+
target_lang VARCHAR2(20)
31+
PATH '$.documents[0].targetLanguageCode'
32+
)) jt;
33+
34+
begin
35+
36+
37+
apex_web_service.g_request_headers.DELETE;
38+
apex_web_service.g_request_headers(1).name := 'Content-Type';
39+
apex_web_service.g_request_headers(1).value := 'application/json';
40+
41+
l_response_json := apex_web_service.make_rest_request
42+
(p_url => l_rest_url,
43+
p_http_method => 'POST',
44+
p_body => l_body,
45+
p_credential_static_id => l_web_cred);
46+
47+
--:P87_OUTPUT := l_response_json;
48+
49+
For row_1 In C1 Loop
50+
l_text := row_1.text;
51+
l_src_lang := row_1.src_lang;
52+
l_target_lang := row_1.target_lang;
53+
:P87_SRC_LANG := l_src_lang;
54+
:P87_TRG_LANG := l_target_lang;
55+
:P87_OUTPUT := l_text;
56+
End Loop;
57+
58+
end;

0 commit comments

Comments
 (0)