Commit 9840212d authored by S.T. Galappaththi's avatar S.T. Galappaththi

Merge branch 'IT20167264' into 'master'

It20167264

See merge request !104
parents 53b1e8a4 60e04eba
......@@ -82,11 +82,14 @@ class LLMConfig:
return dictionary
@staticmethod
# function for predict words
def berto_predict(sentence: str) -> Tuple[str, str]:
API_TOKEN = "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"
API_URL = "https://api-inference.huggingface.co/models/keshan/SinhalaBERTo"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
# Use the API
# Getting the similar words
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
......@@ -95,16 +98,20 @@ class LLMConfig:
"inputs": sentence,
})
# Pass the similar words
lines = output
line = lines[0]
return line["sequence"], line["token_str"]
@staticmethod
# function for predict most similar words
def berto_predict_top(sentence: str) -> list:
API_TOKEN = "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"
API_URL = "https://api-inference.huggingface.co/models/keshan/SinhalaBERTo"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
# Use the API
# Getting the most similar word
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
......@@ -113,6 +120,7 @@ class LLMConfig:
"inputs": sentence,
})
# Pass the most similar word
list_out = []
lines = output
for line in lines:
......
......@@ -11,6 +11,7 @@ from sinlingua.grammar_rule.rule_based_past_1 import PastFirstPerson
from sinlingua.grammar_rule.rule_based_past_2 import PastSecondPersonSingular
from sinlingua.grammar_rule.rule_based_past_3 import PastSecondPersonPlural
from sinlingua.grammar_rule.mask import PredictNoun
# Imported all grammar rules together in grammar main
class GrammarMain:
......@@ -95,8 +96,10 @@ class GrammarMain:
# validated10 = grammar_rule.output(output10)
# call function for every grammar rule at once to get correct output
# if validated1 is None and validated2 is None and validated3 is None and validated4 is None and validated5 is None and validated6 is None and validated7 is None and validated8 is None and validated9 is None:
# pass
# Check all outputs are None
if validated1 is None and validated2 is None and validated3 is None and validated4 is None and validated5 is None and validated6 is None and validated7 is None and validated8 is None and validated9 is None and validated11 is None and validated12 is None:
return sentence
# Check First Person Rules and their Similarity Ratios
if validated1 is not None and validated7 is not None:
if output1[1] < output7[1]:
return output7[0]
......@@ -110,6 +113,7 @@ class GrammarMain:
return output4[0]
elif validated7 is not None:
return output7[0]
# Check Second Person rules and their Similarity Ratios
elif validated2 is not None and validated8 is not None:
if output2[1] < output8[1]:
return output8[0]
......@@ -121,6 +125,7 @@ class GrammarMain:
return output8[0]
elif validated2 is not None:
return output2[0]
# Check Third Person Rules and their Similarity Ratios
elif validated3 is not None and validated9 is not None:
if output3[1] < output9[1]:
return output9[0]
......@@ -132,8 +137,10 @@ class GrammarMain:
return output9[0]
elif validated3 is not None:
return output3[0]
# Check Fourth Person Rules and their Similarity Ratios
elif validated12 is not None:
return output12[0]
# Check Plural & Singular Rules and their Similarity Ratios
elif validated5 is not None and validated6 is not None and validated11 is not None:
if output5[1] < output6[1]:
if output6[1] < output11[1]:
......@@ -150,18 +157,20 @@ class GrammarMain:
return output6[0]
if output5[1] > output6[1]:
return output5[0]
if output5[1] == output6[1]:
return output6[0]
elif validated5 is not None:
return output5[0]
elif validated6 is not None:
return output6[0]
elif validated11 is not None:
return output11[0]
# if function returns any correct output is displayed
# if function returns any correct output is returned
# if __name__ == "__main__":
# obj = GrammarMain()
# sent = "තොපි ආහාර ලෑස්ති කරාද"
# sent = "සංගමයේ සාමාජිකයින් සමිතිය අවසන් බැවින් විසිය යනව"
# out = obj.mapper(sentence=sent)
# print(out)
......@@ -183,3 +192,7 @@ class GrammarMain:
# සංගමයේ සාමාජිකයින් සමිතිය අවසන් බැවින් විසිය යනව
# ඇය මල් නෙලුවා
# ඔහු මල් නෙලුව
# තී මල් කැඩුවද
# තොපි ආහාර ලෑස්ති කරාද
# ගුරුවරු පිටතට පැමිණ සිටියා
# දරුවා වෙහෙස මහන්සියෙන් ඉගෙන ගන්නවා
......@@ -4,6 +4,7 @@ from googletrans import Translator
class GrammarRules:
@staticmethod
# function for getting similarity score with similar word and actual word
def find_similar_words(list_items, input_string):
words = input_string.split()
max_similarity = 0
......@@ -16,7 +17,7 @@ class GrammarRules:
if similarity_ratio >= 75 and similarity_ratio > max_similarity:
max_similarity = similarity_ratio
similar_word = line
actual_word_of_string = word
actual_word_of_string = word # Finally return similar word, similarity score and actual word
return similar_word, actual_word_of_string, max_similarity
def common_function(self, sentence):
......@@ -24,6 +25,7 @@ class GrammarRules:
pass
@staticmethod
# Check if returns output
def output(output):
if output != "Try Again..Incomplete sentence. No enough data to process":
return output
......
......@@ -2,16 +2,23 @@ from fuzzywuzzy import fuzz
from sinlingua.grammar_rule.grammar_rules import GrammarRules
from sinlingua.src.grammar_rule_resources import verbs
class FirstPerson(GrammarRules):
def common_function(self, sentence):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(verbs, sentence)
# call the function find verb of sentence
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
if verb_checked == 'ගන්නවා':
verb_checked = 'ගනිනවා'
......@@ -25,11 +32,15 @@ class FirstPerson(GrammarRules):
verb_checked = 'ඉන්නෙනවා'
elif verb_checked == 'ආදරෙයි':
verb_checked = 'ආදරය කරනවා'
# Extract the verb stem
verb_stem = verb_checked[:-3]
# Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "මම" or "මා"
if sentence.split()[0] in ["මම", "මා"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["මම", "මා"]):
......@@ -38,6 +49,7 @@ class FirstPerson(GrammarRules):
conjugated_verb = verb_stem + "මි"
# Add the first word as "මම" to the sentence
words[0] = "මම"
# Check if the sentence starts with "අපි"
elif sentence.split()[0] in ["අපි", "අප"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["අපි", "අප"]):
......@@ -46,8 +58,10 @@ class FirstPerson(GrammarRules):
# Add the first word as "අපි" to the sentence
words[0] = "අපි"
conjugated_verb = verb_stem + "මු"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
......
......@@ -7,14 +7,17 @@ class SecondPersonSingular(GrammarRules):
def common_function(self, sentence):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
returned_string_verb = grammar_obj.find_similar_words(verbs, sentence)
# call the function find verb of sentence
# returned_string_verb = find_similar_words(file_path_for_verb, sentence)
returned_string_verb = grammar_obj.find_similar_words(verbs, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
if verb_checked == 'ගන්නවා':
verb_checked = 'ගනිනවා'
......@@ -27,11 +30,14 @@ class SecondPersonSingular(GrammarRules):
elif verb_checked == 'නිදාගන්නවා':
verb_checked = 'නිදාගනිනවා'
# Extract the verb stem
verb_stem = verb_checked[:-3]
# Remove the last word (verb) from the sentence
# Split the sentence and Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "ඇය" or "ඈ"
if sentence.split()[0] in ["ඇය", "ඈ"] or (len(sentence.split()) > 1 and sentence.split()[1] in ["ඇය", "ඈ"]):
if len(words) > 1 and words[1] in ["ඇය", "ඈ"]:
......@@ -50,8 +56,10 @@ class SecondPersonSingular(GrammarRules):
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
if conjugated_verb == '':
return "Try Again..Incomplete sentence. No enough data to process", ratio
......
......@@ -8,10 +8,16 @@ class SecondPersonPlural(GrammarRules):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(verbs, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
if verb_checked == 'ගන්නවා':
verb_checked = 'ගනිනවා'
......@@ -21,11 +27,14 @@ class SecondPersonPlural(GrammarRules):
verb_checked = 'ගන්වනවා'
elif verb_checked == 'නිදාගන්නවා':
verb_checked = 'නිදාගනිනවා'
# Extract the verb stem
verb_stem = verb_checked[:-3]
# Remove the last word (verb) from the sentence
# Split the sentence and Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "ඔවුන්" or "ඔවුහු"
if sentence.split()[0] in ["ඔවුන්", "ඔවුහු"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["ඔවුන්", "ඔවුහු"]):
......@@ -34,8 +43,10 @@ class SecondPersonPlural(GrammarRules):
conjugated_verb = verb_stem + "ති"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
if conjugated_verb == '':
return "Try Again..Incomplete sentence. No enough data to process", ratio
......
......@@ -8,29 +8,39 @@ class FourthPerson(GrammarRules):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
returned_string_verb = grammar_obj.find_similar_words(question_verbs, sentence)
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(question_verbs, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
# Extract the verb stem
verb_stem = verb_checked[:-1]
# Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "තී", "තෝ", "ඔබ", "නුඹ"
if sentence.split()[0] in ["තී", "තෝ", "ඔබ", "නුඹ"]:
if verb_stem[-1] in ["ා"]:
verb_stem = verb_stem[:-1]
conjugated_verb = verb_stem + "ෙහි"
# Check if the sentence starts with "අපි"
elif sentence.split()[0] in ["තෙපිි", "තොපි"]:
if verb_stem[-1] in ["ා"]:
verb_stem = verb_stem[:-1]
conjugated_verb = verb_stem + "ෙහු"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
......
......@@ -8,16 +8,24 @@ class FirstPersonFuture(GrammarRules):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(verbs_2f, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
# Extract the verb stem
verb_stem = verb_checked[:-3]
# Remove the last word (verb) from the sentence
# Split the sentence and Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "මම" or "මා"
if sentence.split()[0] in ["මම", "මා"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["මම", "මා"]):
......@@ -26,8 +34,10 @@ class FirstPersonFuture(GrammarRules):
if verb_stem[-2:] == 'න්':
verb_stem = verb_stem[:-2]
conjugated_verb = verb_stem + "න්නෙමි"
# Add the first word as "මම" to the sentence
words[0] = "මම"
# Check if the sentence starts with "අපි"
elif sentence.split()[0] in ["අපි", "අප"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["අපි", "අප"]):
......@@ -36,12 +46,16 @@ class FirstPersonFuture(GrammarRules):
if verb_stem[-2:] == 'න්':
verb_stem = verb_stem[:-2]
conjugated_verb = verb_stem + "න්නෙමු"
# Add the first word as "අපි" to the sentence
words[0] = "අපි"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
if conjugated_verb == '':
return "Try Again..Incomplete sentence. No enough data to process", ratio
......
......@@ -8,34 +8,46 @@ class PastFirstPerson(GrammarRules):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
returned_string_verb_past = grammar_obj.find_similar_words(past_verbs, sentence)
# call the function find verb of sentence
returned_string_verb_past = grammar_obj.find_similar_words(past_verbs, sentence)
verb_checked_past = returned_string_verb_past[0]
actual_word_past = returned_string_verb_past[1]
ratio_past = returned_string_verb_past[2]
if returned_string_verb_past[0]:
verb_stem_past = verb_checked_past[:-1]
# Remove the last word (verb) from the sentence
# Split the sentence and Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word_past)
# Check if the sentence starts with "මම" or "මා"
if sentence.split()[0] in ["මම", "මා"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["මම", "මා"]):
if len(words) > 1 and words[1] in ["මම", "මා"]:
words.pop(0)
conjugated_verb = verb_stem_past + "ෙමි"
# Add the first word as "මම" to the sentence
words[0] = "මම"
# Check if the sentence starts with "අපි"
elif sentence.split()[0] in ["අපි", "අප"] or (
len(sentence.split()) > 1 and sentence.split()[1] in ["අපි", "අප"]):
if len(words) > 1 and words[1] in ["අපි", "අප"]:
words.pop(0)
# Add the first word as "අපි" to the sentence
words[0] = "අපි"
conjugated_verb = verb_stem_past + "ෙමු"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
......
......@@ -7,26 +7,33 @@ class PastSecondPersonSingular(GrammarRules):
def common_function(self, sentence):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
returned_string_verb = grammar_obj.find_similar_words(past_verbs, sentence)
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(past_verbs, sentence)
# returned_string_verb = find_similar_words(file_path_for_verb, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
# Extract the verb stem
# verb_stem = verb_checked[:-2]
# Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "ඇය" or "ඈ"
if sentence.split()[0] in ["ඇය", "ඈ"] or (len(sentence.split()) > 1 and sentence.split()[1] in ["ඇය", "ඈ"]):
if len(words) > 1 and words[1] in ["ඇය", "ඈ"]:
words.pop(0)
# verb_stem = verb_checked[:-2]
conjugated_verb = verb_checked + "ය"
# Add the first word as "ඇය" to the sentence
words[0] = "ඇය"
......@@ -36,13 +43,16 @@ class PastSecondPersonSingular(GrammarRules):
words.pop(0)
verb_stem = verb_checked[:-1]
conjugated_verb = verb_stem + "ේය"
# Add the first word as "ඔහු" to the sentence
words[0] = "ඔහු"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
if conjugated_verb == '':
return "Try Again..Incomplete sentence. No enough data to process", ratio
......
......@@ -8,25 +8,36 @@ class PastSecondPersonPlural(GrammarRules):
global conjugated_sentence
grammar_obj = GrammarRules()
conjugated_verb = ''
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(past_verbs, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
ratio = returned_string_verb[2]
if returned_string_verb[0]:
# Extract the verb stem
verb_stem = verb_checked[:-1]
# Remove the last word (verb) from the sentence
# Split the sentence and Remove the last word (verb) from the sentence
words = sentence.split()
words.remove(actual_word)
# Check if the sentence starts with "ඔවුන්" or "ඔවුහු"
if sentence.split()[0] in ["ඔවුන්", "ඔවුහු"] or (len(sentence.split()) > 1 and sentence.split()[1] in ["ඔවුන්", "ඔවුහු"]):
if len(words) > 1 and words[1] in ["ඔවුන්", "ඔවුන්"]:
words.pop(0)
conjugated_verb = verb_stem + "ෝය"
# Append the conjugated verb to the sentence
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
if conjugated_verb == '':
return "Try Again..Incomplete sentence. No enough data to process", ratio
......
......@@ -9,40 +9,59 @@ class PluralSubject(GrammarRules):
global conjugated_sentence
prefixes = ["මා", "අපි", "මම", "ම", "අප", "ඔහු", "ඇය", "ඈ", "ඔවුන්", "ඔවුහු"]
conjugated_verb = ''
# call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(verbs, sentence)
newsentence = sentence
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
# call the function find subject of sentence
returned_string_subject = grammar_obj.find_similar_words(nouns_subject_plural, sentence)
subject_checked = returned_string_subject[0]
actual_subject = returned_string_subject[1]
ratio = returned_string_subject[2]
if returned_string_verb[0]:
# Extract the verb stem
verb_stem = verb_checked[:-3]
if returned_string_subject[0]:
sentence = sentence.replace(actual_subject, subject_checked)
words = sentence.split()
if returned_string_subject[0]:
if verb_stem[-1] in ["්"]:
verb_stem = verb_stem[:-1]
verb_stem = verb_stem + "ි"
# Adding "ති" for the stem
conjugated_verb = verb_stem + "ති"
# Remove the last word (verb) from the sentence
# Split the sentence and Remove the last word (verb) from the sentence
words.remove(actual_word)
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
elif any(sentence.startswith(prefix) or sentence.split()[1] == prefix for prefix in prefixes):
conjugated_verb = ''
else:
words.remove(actual_word)
conjugated_verb = verb_stem + "මින් ඇත"
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
# print("Sorry.........This may be wrong. No enough data to process_plural")
""""# Translate Sinhala sentence to English
english_translation = translate_sinhala_to_english(' '.join(words))
......
......@@ -9,37 +9,58 @@ class PluralSubjectPast(GrammarRules):
global conjugated_sentence
prefixes = ["මා", "අපි", "මම", "ම", "අප", "ඔහු", "ඇය", "ඈ", "ඔවුන්", "ඔවුහු"]
conjugated_verb = ''
# split the sentence
wordlist = sentence.split()
# call the function find verb of sentence
returned_string_verb_past = grammar_obj.find_similar_words(past_verbs, wordlist[-1])
verb_checked_past = returned_string_verb_past[0]
actual_word_past = returned_string_verb_past[1]
# call the function find subject of sentence
returned_string_subject_past = grammar_obj.find_similar_words(nouns_subject_plural, wordlist[0])
subject_checked_past = returned_string_subject_past[0]
actual_subject_past = returned_string_subject_past[1]
ratio = returned_string_subject_past[2]
if returned_string_verb_past[0]:
# Extract the verb stem
verb_stem = verb_checked_past[:-1]
if returned_string_subject_past[0]:
sentence = sentence.replace(actual_subject_past, subject_checked_past)
# Split the sentence
words = sentence.split()
if returned_string_subject_past[0]:
# Adding "ති" for the stem
conjugated_verb = verb_stem + "ෝය"
# Remove the last word (verb) from the sentence
words.remove(actual_word_past)
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
elif any(sentence.startswith(prefix) or sentence.split()[1] == prefix for prefix in prefixes):
conjugated_verb = ''
else:
words.remove(actual_word_past)
conjugated_verb = verb_stem + "මින් ඇත"
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
# print("Sorry.........This may be wrong. No enough data to process_plural")
""""# Translate Sinhala sentence to English
english_translation = translate_sinhala_to_english(' '.join(words))
......
......@@ -8,37 +8,56 @@ class SingularSubject(GrammarRules):
global conjugated_sentence
prefixes = ["මා", "අපි", "මම", "ම", "අප", "ඔහු", "ඇය", "ඈ", "ඔවුන්", "ඔවුහු"]
conjugated_verb = ''
# # call the function find verb of sentence
returned_string_verb = grammar_obj.find_similar_words(verbs, sentence)
verb_checked = returned_string_verb[0]
actual_word = returned_string_verb[1]
# # call the function find subject of sentence
returned_string_subject = grammar_obj.find_similar_words(nouns_subject_singular, sentence)
subject_checked = returned_string_subject[0]
actual_subject = returned_string_subject[1]
ratio = returned_string_subject[2]
if returned_string_verb[0]:
# Extract the verb stem
verb_stem = verb_checked[:-3]
if returned_string_subject[0]:
sentence = sentence.replace(actual_subject, subject_checked)
# Split the sentence
words = sentence.split()
if returned_string_subject[0]:
if verb_stem[-1] in ["්"]:
verb_stem = verb_stem[:-1]
verb_stem = verb_stem + "ි"
# Adding "ති" for the stem
conjugated_verb = verb_stem + "යි"
# Remove the last word (verb) from the sentence
words.remove(actual_word)
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
elif any(sentence.startswith(prefix) or sentence.split()[1] == prefix for prefix in prefixes):
conjugated_verb = ''
else:
words.remove(actual_word)
conjugated_verb = verb_stem + "මින් ඇත"
words.append(conjugated_verb)
# Reconstruct the sentence
conjugated_sentence = " ".join(words)
# print("Sorry.........This may be wrong. No enough data to process_singular")
......
grammar_rule_llm_config = {
"api_key":"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",
"org_key":"org-FAg23PQBtCvq57kZHYd0HYlW",
"model": "gpt-3.5-turbo",
"temperature": 0,
"max_tokens": 2000,
"Top_P": 1,
"Frequency_penalty": 0,
"Presence_penalty": 0,
"max_characters": 4000,
"TC_Only": "NO",
"Prompts": [
{
"role": "user",
"content": "I need you to identify the given Sinhala word singular or plural. Make sure to give the output in the following JSON structure.\nJSON structure:\n{\n \"<word>\": \"<singular/plural>\"\n}\n\nWord: '{{word}}'"
},
{
"role": "user",
"content": ""
}
]
"api_key": "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",
"org_key": "org-FAg23PQBtCvq57kZHYd0HYlW",
"model": "gpt-3.5-turbo",
"temperature": 0,
"max_tokens": 2000,
"Top_P": 1,
"Frequency_penalty": 0,
"Presence_penalty": 0,
"max_characters": 4000,
"TC_Only": "NO",
"Prompts": [
{
"role": "user",
"content": "I need you to identify the given Sinhala word singular or plural. Make sure to give the output in the following JSON structure.\nJSON structure:\n{\n \"<word>\": \"<singular/plural>\"\n}\n\nWord: '{{word}}'"
},
{
"role": "user",
"content": ""
}
]
}
nouns_subject_plural = [
......@@ -495,4 +495,5 @@ verbs_2f = [
"බොන්නම්",
"උයන්නම්",
"හදන්නම්",
]
\ No newline at end of file
"දෙන්නම්",
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment