Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,9 @@ import pykakasi
|
|
22 |
import hangul_romanize
|
23 |
import pinyin
|
24 |
from langdetect import detect
|
|
|
|
|
|
|
25 |
|
26 |
#Uncomment these for Huggingface
|
27 |
nltk.download('maxent_ne_chunker') #Chunker
|
@@ -38,6 +41,8 @@ nltk.download('names') #People Names NER
|
|
38 |
nltk.download('gazetteers') #Location NER
|
39 |
nltk.download('opinion_lexicon') #Sentiment words
|
40 |
nltk.download('averaged_perceptron_tagger') #Parts of Speech Tagging
|
|
|
|
|
41 |
|
42 |
spacy.cli.download("en_core_web_sm")
|
43 |
spacy.cli.download('ko_core_news_sm')
|
@@ -520,6 +525,7 @@ def UnknownTrackTexttoApp(text): #Copy of def OptimisedTtAppForUNWFWO(text):
|
|
520 |
FinalOutput = ""
|
521 |
#sentence = "One Piece chapter 1049 spoilers Thanks to Etenboby from WG forums Chapter 1049: **\"The world we should aspire to\"** * In the cover, someone burned Niji and Yonji\u2019s book * Kaido flashback time. We see his childhood in Vodka Kingdom, and where a few years later he met Whitebeard who told him that Rocks wants to meet him * In the present, part of Raizo\u2019s water leaves the castle and flame clouds disappear. But Momo makes a new one. * Luffy says he will create a world where none of his friends would starve, then he hits Kaido and Kaido falls to the ground of the flower capital. * In another flashback, Kaido tells King that Joy Boy will be the man that can defeat him. **Additional info** *Flashback to Kaidou as a kid* *- His country tries to sell him to the marines but he escapes* *- He rampages in Hachinosu(i think it's blackbeard's island) and Rocks invites him to his crew* *- Young WB appears* *- Rocks flashback suddenly ends* *- Higurashi invites Kaidou* *- The flashback ends with Kaidou telling King he knows who Joy Boy is.* *Back to the present* \\- *Denjirou hugs Hiyori* \\- *Luffy's punch hits Kaidou* *Flashback continues* \\- *King asks: Who is it then?* \\- *Kaidou: The one who will defeat me* \\- *King: Then he will not appear* \\- *Onigashima falls near the capital* \\- *Momo falls* **BREAK NEXT WEEK** https://www.reddit.com/r/OnePiece/comments/umu2h0/one_piece_chapter_1049_spoilers/" #@param {type: "string"}
|
522 |
HTMLMainbody = ""
|
|
|
523 |
|
524 |
doc = nlp(text)
|
525 |
iIDNumber = 0
|
@@ -534,18 +540,22 @@ def UnknownTrackTexttoApp(text): #Copy of def OptimisedTtAppForUNWFWO(text):
|
|
534 |
for token in doc:
|
535 |
if (token.pos_ == "VERB") or (token.pos_ == "AUX"):
|
536 |
HTMLMainbody = HTMLMainbody + "<button id='btn" + str(iVerbCount) + "' onclick=HighlightWord('btn" + str(iVerbCount) + "')> " + token.text + "</button> "
|
|
|
537 |
allverbids = allverbids + str(iVerbCount) + " "
|
538 |
iVerbCount += 1
|
539 |
iWords += 1
|
540 |
allverbs = allverbs + token.text + " "
|
541 |
elif token.pos_ == "NOUN":
|
542 |
-
HTMLMainbody = HTMLMainbody + "<label class='Nouns' id='lbl" + token.text + "'>" + token.text + " </label>"
|
|
|
543 |
iNounCount += 1
|
544 |
iWords += 1
|
545 |
elif token.pos_ == "PUNCT":
|
546 |
HTMLMainbody = HTMLMainbody + token.text
|
|
|
547 |
else:
|
548 |
HTMLMainbody = HTMLMainbody + token.text + " "
|
|
|
549 |
iWords += 1
|
550 |
iIDNumber += 1
|
551 |
|
@@ -553,6 +563,7 @@ def UnknownTrackTexttoApp(text): #Copy of def OptimisedTtAppForUNWFWO(text):
|
|
553 |
allverbidslist = allverbids.split()
|
554 |
|
555 |
FinalHTML = ""
|
|
|
556 |
FinalCSS = ""
|
557 |
FinalJS = ""
|
558 |
|
@@ -619,7 +630,9 @@ def UnknownTrackTexttoApp(text): #Copy of def OptimisedTtAppForUNWFWO(text):
|
|
619 |
}
|
620 |
'''
|
621 |
|
|
|
622 |
FinalHTML = FinalHTML + "\n<div><hr>\n" + HTMLMainbody + "\n"
|
|
|
623 |
#FinalHTML = FinalHTML + '''</div><hr>
|
624 |
#<button onclick=OnlyUnknownSentences() id="btnOnlyUnknownSentences">Only Unknown Sentences Put this function in a timer to keep up to date without input</button>
|
625 |
#'''
|
@@ -648,14 +661,21 @@ def UnknownTrackTexttoApp(text): #Copy of def OptimisedTtAppForUNWFWO(text):
|
|
648 |
\n
|
649 |
'''
|
650 |
|
|
|
|
|
|
|
|
|
|
|
651 |
FinalOutput = FinalHTML + FinalCSS + FinalJS
|
|
|
|
|
652 |
|
653 |
HTMLDownloadTemp = f'UnknownVerbTrack.html'
|
654 |
|
655 |
with open(HTMLDownloadTemp, 'w') as f:
|
656 |
f.write(FinalOutput)
|
657 |
|
658 |
-
return HTMLDownloadTemp,
|
659 |
|
660 |
#Kathryn Lingel - Pyambic Pentameter Example - PyCon US
|
661 |
#Basic Language Model Code
|
@@ -789,15 +809,15 @@ def changeexposuretext(text):
|
|
789 |
|
790 |
#-------------------------------------------------------------------------------------------------------------------------------
|
791 |
|
792 |
-
def
|
793 |
-
|
794 |
|
795 |
-
|
|
|
796 |
|
797 |
-
|
798 |
|
799 |
-
|
800 |
-
return Finalvideo
|
801 |
|
802 |
def AutoSyllablePractice(String):
|
803 |
FinalOutput = ""
|
@@ -926,6 +946,248 @@ def GuidedReading(textspreprocess,seperator):
|
|
926 |
|
927 |
return FinalOutput
|
928 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
929 |
guidedreadingseperator = gr.Dropdown(choices=[".", ",", "lines", "Sentences"], value=".", interactive=True)
|
930 |
textspreprocess = [
|
931 |
["Bing created this example \nApple is looking at buying U.K. startup for $1 billion \nApple schaut sich für 1 Milliarde Dollar ein Startup aus Großbritannien an \nApple está mirando comprar una startup del Reino Unido por mil millones de dólares \n애플은 영국의 스타트업을 10억 달러에 사려고 한다 \nアップルは、英国のスタートアップを10億ドルで買収する予定だ \n苹果正考虑以10亿美元收购英国初创公司", "\n"]
|
@@ -933,7 +1195,7 @@ textspreprocess = [
|
|
933 |
|
934 |
LLPromptIdeas = """
|
935 |
|
936 |
-
|
937 |
|
938 |
Bings Explanation
|
939 |
Youre welcome. Im happy to help. If I wanted to explain the rules of this game clearly and concisely, I would do something like this:
|
@@ -946,7 +1208,7 @@ The player who finds the <<Chinese>> word and makes the mnemonic should write th
|
|
946 |
|
947 |
<hr>
|
948 |
|
949 |
-
|
950 |
|
951 |
The game can be played with any number of people.
|
952 |
One person starts by stating a syllogism, which is a logical argument that consists of three parts: a major premise, a minor premise, and a conclusion.
|
@@ -976,11 +1238,24 @@ next sentence is AI Town is a virtual town where AI characters live, chat and so
|
|
976 |
|
977 |
"""
|
978 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
979 |
def display_website(link):
|
980 |
html = f"<iframe src='{link}' width='100%' height='1000px'></iframe>"
|
981 |
-
|
982 |
return html
|
983 |
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
|
985 |
randomExposuremessageText = ["Great Test for LLM function calling (with Gradio Client)", "Unknown Tracker Tab = Incomplete Reading Assistant Idea - HTML app based on text to be read", "Bing mnemonic - lost = dont ignore unusual sounds here inside lost cave", "1000 verbs in lists of 100, verbs = easy setence structure estimation (SVO, SOV, etc.)", "Can put any message here in the navigatoin tab"]
|
986 |
|
@@ -990,6 +1265,49 @@ def randommarquee():
|
|
990 |
#randomExposuremessagelistitem2 = str(random.sample(randomExposuremessageText, 1)).replace("['", "").replace("']", "")
|
991 |
return f" <marquee> { randomExposuremessagelistitem } </marquee> "
|
992 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
993 |
|
994 |
# Define the Gradio interface inputs and outputs for video split
|
995 |
spvvideo_file_input = gr.File(label='Video File')
|
@@ -1007,53 +1325,86 @@ randomExposuremessage = randommarquee()
|
|
1007 |
randomExposuremessage2 = randommarquee()
|
1008 |
|
1009 |
VideoTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
|
|
|
|
|
1010 |
|
1011 |
with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', secondary_hue='red', neutral_hue='blue', )
|
1012 |
-
gr.HTML('<div style="display: flex; justify-content: center; align-items: center; height: 100%;"> ---- Under Construction: Slowly figuring out what AI intergrated interface means (Chat vs Forms vs Function calling vs Sensor + Trigger)
|
1013 |
-
with gr.
|
1014 |
-
PracticeExposure = gr.HTML(randomExposuremessage)
|
1015 |
-
PracticeExposure2 = gr.HTML(randomExposuremessage2)
|
1016 |
-
with gr.Row():
|
1017 |
-
with gr.Column(scale=1):
|
1018 |
-
gr.HTML("Advanced Repitition = Combinatorics --> to understand a sentence properly you need understanding of every word --> in language that means use with other words --> Combos within the unique words in a sentence, paragraph, page, etc. --> as close to 3 word sentences")
|
1019 |
-
with gr.Column(scale=1):
|
1020 |
-
gr.HTML("<p>Timing Practice - Repitition: Run from it, Dread it, Repitition is inevitable - Thanos --> Repitition of reaction - Foreign in eyes/ears native in mind (For beginners) | Repitition is a multitask activity like driving must be subconcious process to show mastery </p>")
|
1021 |
-
gr.HTML(""" <a href='https://github.com/eugeneyan/open-llms'> -- Opensource List -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard'> -- Open LLM Leaderboard -- </a> | <a href='https://huggingface.co/spaces/sanchit-gandhi/whisper-jax'> -- Whisper JAX -- </a> | <a href="https://translate.google.com/?hl=en&tab=TT"> -- Google Translate -- </a> | <a href='https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis'> -- Modelscope Text to Video -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion'> -- stable-diffusion 2 -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion-1'> -- stable-diffusion 1 -- </a> | <a href='https://huggingface.co/spaces/kakaobrain/karlo'> -- karlo 1 -- </a> | <a href='https://huggingface.co/spaces/suno/bark'> -- Bark (TTS) -- </a> | <a href='https://chat.lmsys.org/'> -- Offline Text Model Demos -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a> | <a href='https://beta.elevenlabs.io/'> -- Eleven Labs -- </a> | <a href='https://www.d-id.com/'> -- Animate an Image -- </a> | <a href='https://voice.ai/'> -- Clone a voice -- </a> | <a href='https://openai.com/pricing'> -- OpenAI pricing -- </a> | <a href='https://huggingface.co/spaces/sohojoe/soho-clip-embeddings-explorer'> -- Image Training Data Search -- </a> | <a href='https://huggingface.co/spaces/huggingchat/chat-ui'> -- Huggingface Chat -- </a> | <a href='https://huggingface.co/spaces/bguisard/stable-diffusion-nano'> -- 128x128 Stable Diffusion (Fast) -- </a> | <a href='https://huggingface.co/spaces/colonelwatch/abstracts-index'> -- Search 95 million research abstracts -- </a> | <a href='https://huggingface.co/datasets/roneneldan/TinyStories'> -- Tiny Stories Dataset -- </a> | <a href='https://huggingface.co/spaces/lykeven/visualglm-6b'> -- Visualglm6b - Discuss images -- </a> | <a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/camenduru/potat1'> -- Potat1 Text2vid -- </a> | <a href='https://twitter.com/willdepue/status/1661781355452325889'> -- Alexandria Prohect (Will Deque) - Free Embeddings -- </a> | <a href='https://artsandculture.google.com/'> -- Google Arts and Culture Portal -- </a> | <a href='https://huggingface.co/spaces/Matthijs/whisper_word_timestamps'> -- Word Level Timestamps -- </a> | <a href='https://huggingface.co/spaces/zaanind/NLLB-translation'> -- NLLB 600M Demo -- </a> | <a href='https://huggingface.co/spaces/hysts/zeroscope-v2'> -- Zeroscope v2 Text to video -- </a> | <a href='https://huggingface.co/spaces/SpacesExamples/ComfyUI'> -- ComfyUI Text to Image -- </a> | <a href='https://huggingface.co/spaces/DeepFloyd/IF'> -- Deepfloyd IF - Text in image -- </a> | <a href='https://huggingface.co/spaces/ysharma/ChatGPT-Plugins-in-Gradio'> -- ChatGPT Custom Plugins Test Space -- </a> | <a href='https://www.reddit.com/r/LocalLLaMA/'> -- r/LocalLlama -- </a> | <a href='https://www.reddit.com/r/singularity/'> -- r/Singularity -- </a> | <a href='https://huggingface.co/spaces/hysts/SD-XL'> -- SD-XL Test Space -- </a> | <a href='https://huggingface.co/spaces/facebook/seamless_m4t'> -- Seamless M4T - Translation one stop shop -- </a> | <a href='https://huggingface.co/spaces/codellama/codellama-playground'> -- Code Llama playground -- </a> | <a href='https://huggingface.co/spaces/Voicemod/Text-to-Sing'> -- Text to sing -- </a> | <a href='https://huggingface.co/spaces/camenduru-com/webui'> -- Stable Diffusion Webui (Camenduru Space) -- </a> | <a href='https://huggingface.co/spaces/ysharma/WizardCoder34b'> -- Wizard Coder 34B -- </a> | <a href='https://huggingface.co/spaces/chansung/co-write-with-llama2'> -- Cowrite with llama2 -- </a> | <a href='https://huggingface.co/spaces/fffiloni/Image-to-Story'> -- Image to Story -- </a> | <a href='https://huggingface.co/spaces/fffiloni/CLIP-Interrogator-2'> -- Clip interrogator 2 -- </a> | <a href='https://github.com/THUDM/AgentBench'> -- Agent Benchmarks -- </a> | <a href='https://www.convex.dev/ai-town'> -- AI Town Live Demo -- </a> = <a href='https://github.com/a16z-infra/ai-town'> -- AI Town Repository (Deployment]) -- </a> | <a href='https://github.com/joonspk-research/generative_agents/tree/main'> -- Generative Agents: Interactive Simulacra of Human Behavior (Research paper Repository) -- </a> | """)
|
1022 |
-
with gr.Accordion("LLM HF Spaces (Click Here to Open) - Ask for Translation of image tags made below, sentence to emojis, Wordlists, Test Conversations, Get Grammar Explanations etc., Can use GPT-4 or new SOTA to review the conversation", open=False):
|
1023 |
with gr.Row():
|
1024 |
-
linktochat = gr.Dropdown(choices=["https://sdk.vercel.ai/docs", "https://lmsys-
|
1025 |
chatspacebtn = gr.Button("Use the chosen URL to load interface with a chat model. For sdk.vercel click the chat button on the top left")
|
1026 |
-
with gr.
|
1027 |
-
|
1028 |
-
|
|
|
|
|
|
|
|
|
1029 |
with gr.Row():
|
1030 |
with gr.Column(scale=1):
|
1031 |
-
with gr.
|
1032 |
-
gr.
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
gr.
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
gr.
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
|
|
|
|
|
|
|
|
|
|
1050 |
with gr.Column(scale=3):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1051 |
with gr.Tab("Beginner - Listen + Read"):
|
1052 |
-
gr.Label("1 new word a minute while recycling the words from the previous minutes")
|
1053 |
with gr.Row():
|
1054 |
with gr.Column(scale=1):
|
1055 |
gr.HTML("Listening - Songs - Chorus <br> Anticipation of the item to remember is how you learn lyrics that is why songs are easy as if you heard it 10 times already your capacity to anticipate the words is great <br><br> This is where TTS helps as you are ignoring all words except the words just before the actual <br> <b>Tiny Stories dataset is like a graded reader</b> <br>")
|
1056 |
gr.Interface(fn=TTSforListeningPractice, inputs=["text", TTSLangOptions, "checkbox"], outputs="audio", description="Paste chorus lyrics from below here and use TTS or make notes to save here (Or paste anything)")
|
|
|
|
|
|
|
|
|
|
|
1057 |
gr.HTML("<p>Fastest way to learn words = is to have your own sound reference --> probably why babies learn fast as they make random noise</p> <p>If you know the flow of the song you can remember the spelling easier</p><p>Essentially if the sounds are repeated or long notes they are easy to remember</p>")
|
1058 |
gr.Interface(fn=AutoChorusInvestigator, inputs="text", outputs="text", description="Paste Full Lyrics to try find only chorus lines")
|
1059 |
gr.Interface(fn=AutoChorusPerWordScheduler, inputs="text", outputs="text", description="Create order of repitition for tts practice")
|
@@ -1073,10 +1424,52 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
|
|
1073 |
gr.Interface(fn=add_text_to_image , inputs=["image", "text"], outputs="image", description="Create Annotated images (Can create using stable diffusion and use the prompt) - Describe from one side to the other to make guessing easy")
|
1074 |
#with gr.Tab("Transcribe - RASMUS Whisper"):
|
1075 |
#gr.Interface.load("spaces/RASMUS/Whisper-youtube-crosslingual-subtitles", title="Subtitles")
|
1076 |
-
with gr.Tab("Beginner -
|
1077 |
-
gr.HTML("
|
1078 |
-
|
1079 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1080 |
gr.HTML("<a href='https://www.lingq.com/en/'>Find LingQ Here --> https://www.lingq.com/en/</a>")
|
1081 |
with gr.Tab("Visual - Multiline Custom Video Subtitles"):
|
1082 |
gr.HTML("LingQ Companion Idea - i.e. Full Translation Read along, and eventually Videoplayer watch along like RAMUS whisper space <br><br>Extra functions needed - Persitent Sentence translation, UNWFWO, POS tagging and Word Count per user of words in their account. Macaronic Text is also another way to practice only the important information")
|
@@ -1135,65 +1528,85 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
|
|
1135 |
gr.Textbox("Merged Spelling Practice Placeholder - Spell multiple words simultaneously for simultaneous access", lines=3)
|
1136 |
gr.HTML("<p> Spell multiple words simultaneously for simultaneous access </p> <p> Spelling Simplification - Use a dual language list? | Spelling is the end goal, you already know many letter orders called words so you need leverage them to remember random sequences")
|
1137 |
gr.Interface(fn=create_dictionary, inputs="text", outputs="text", title="Sort Text by first two letters")
|
1138 |
-
gr.Interface(fn=keep_nouns_verbs, inputs=["text"], outputs="text", description="Noun and Verbs only (Plus punctuation)")
|
1139 |
-
with gr.Tab("Unknown Tracker"):
|
1140 |
-
gr.HTML("Repitition of things you know is a waste of time when theres stuff you dont know <p> In Language the goal is bigger vocab --> Knowledge equivalent = question answer pairs but to get to those you need related information pairs</p> <p> Vocab = Glossary + all non text wall(lists, diagrams, etc.)</p>")
|
1141 |
-
gr.Textbox("Placeholder for a function that creates a set list and can takes a list for known words and auto find replaces the stuff you know out of the content")
|
1142 |
-
gr.Textbox("Place holder for a translate to english interface so that highlighting can still work as only english supported for now")
|
1143 |
-
gr.Interface(fn=UnknownTrackTexttoApp, inputs="text", outputs=["file", "html", "text"], description="HTML mini App - UNNWFWO (To track verbs you dont know for listening practice). Use the text from here to create lists you use for the TTS section")
|
1144 |
-
with gr.Tab("Unique word ID - use in Infranodus"):
|
1145 |
-
with gr.Accordion(label="Infranodus", open=False):
|
1146 |
-
gr.HTML(" <a href='https://infranodus.com/'> -- Infranodus - Word Level Knowledge graphs -- </a> | <br> Use the below interfaces to find the items that dont have entries --> These will represent new concepts or people which need to be understood individually to fully understand the text --> Infranodus search will help find related and unrelated investigation paths <br><br> TODO Figure Output Zoom / Image Dimensions")
|
1147 |
-
gr.Image(source="upload", label="Open Infranodus Screenshot")
|
1148 |
-
gr.Image(source="upload", label="Open Infranodus Screenshot")
|
1149 |
-
gr.Interface(fn=unique_word_count, inputs="text", outputs="text", description="Wordcounter")
|
1150 |
-
gr.Interface(fn=SepHypandSynExpansion, inputs="text", outputs=["text", "text"], description="Word suggestions - Analyse the unique words in infranodus")
|
1151 |
-
gr.Interface(fn=WikiSearch, inputs="text", outputs="text", description="One word at a time Unique word suggestions (wiki articles)")
|
1152 |
-
with gr.Tab("Automating related information linking"):
|
1153 |
-
gr.HTML("Questions - Taking and suggesting questions to ask = new education --> Esp. Infranodus type outer discourse identification as question generation")
|
1154 |
-
gr.HTML("The point of reading is to refine future actions especially problem solving --> Creating problem scenarios = thinking ahead of time = One form of effective reading")
|
1155 |
with gr.Tab("Thinking Practice (POS)"):
|
1156 |
gr.HTML("By removing all nouns and verbs you get a format to practice thinking about your words to use to make sentences which make sense within constraints")
|
1157 |
-
with gr.
|
1158 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
1159 |
with gr.Tab("Knowledge Ideas - Notetaking"):
|
1160 |
gr.HTML("""<p>Good knowledge = ability to answer questions --> find Questions you cant answer and look for hidden answer within them </p>
|
1161 |
<p>My One Word Theory = We only use more words than needed when we have to or are bored --> Headings exist because title is not sufficient, subheadings exist because headings are not sufficient, Book Text exists because subheadings are not sufficient</p>
|
1162 |
<p>Big Picture = Expand the Heading and the subheadings and compare them to each other</p>
|
1163 |
<p>Application of Knowledge = App Version of the text (eg. Jupyter Notebooks) is what you create and learn first</p>
|
1164 |
""")
|
|
|
1165 |
gr.Interface(fn=TextCompFormat, inputs=["textarea", HTMLCompMode], outputs="text", description="Convert Text to HTML Dropdown or Links which you paste in any html file")
|
1166 |
gr.Interface(fn=create_collapsiblebutton, inputs=["textbox", "textbox", "textarea"], outputs="textbox", description="Button and Div HTML Generator, Generate the HTML for a button and the corresponding div element.")
|
1167 |
-
with gr.Tab("
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
with gr.Tab("
|
1186 |
-
gr.
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
with gr.
|
1194 |
-
gr.HTML(
|
1195 |
-
|
1196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1197 |
|
1198 |
-
|
1199 |
lliface.queue().launch() #(inbrowser="true")
|
|
|
22 |
import hangul_romanize
|
23 |
import pinyin
|
24 |
from langdetect import detect
|
25 |
+
import datetime
|
26 |
+
import cv2
|
27 |
+
import math
|
28 |
|
29 |
#Uncomment these for Huggingface
|
30 |
nltk.download('maxent_ne_chunker') #Chunker
|
|
|
41 |
nltk.download('gazetteers') #Location NER
|
42 |
nltk.download('opinion_lexicon') #Sentiment words
|
43 |
nltk.download('averaged_perceptron_tagger') #Parts of Speech Tagging
|
44 |
+
nltk.download('udhr') # Declaration of Human rights in many languages
|
45 |
+
|
46 |
|
47 |
spacy.cli.download("en_core_web_sm")
|
48 |
spacy.cli.download('ko_core_news_sm')
|
|
|
525 |
FinalOutput = ""
|
526 |
#sentence = "One Piece chapter 1049 spoilers Thanks to Etenboby from WG forums Chapter 1049: **\"The world we should aspire to\"** * In the cover, someone burned Niji and Yonji\u2019s book * Kaido flashback time. We see his childhood in Vodka Kingdom, and where a few years later he met Whitebeard who told him that Rocks wants to meet him * In the present, part of Raizo\u2019s water leaves the castle and flame clouds disappear. But Momo makes a new one. * Luffy says he will create a world where none of his friends would starve, then he hits Kaido and Kaido falls to the ground of the flower capital. * In another flashback, Kaido tells King that Joy Boy will be the man that can defeat him. **Additional info** *Flashback to Kaidou as a kid* *- His country tries to sell him to the marines but he escapes* *- He rampages in Hachinosu(i think it's blackbeard's island) and Rocks invites him to his crew* *- Young WB appears* *- Rocks flashback suddenly ends* *- Higurashi invites Kaidou* *- The flashback ends with Kaidou telling King he knows who Joy Boy is.* *Back to the present* \\- *Denjirou hugs Hiyori* \\- *Luffy's punch hits Kaidou* *Flashback continues* \\- *King asks: Who is it then?* \\- *Kaidou: The one who will defeat me* \\- *King: Then he will not appear* \\- *Onigashima falls near the capital* \\- *Momo falls* **BREAK NEXT WEEK** https://www.reddit.com/r/OnePiece/comments/umu2h0/one_piece_chapter_1049_spoilers/" #@param {type: "string"}
|
527 |
HTMLMainbody = ""
|
528 |
+
GradHTMLMainbody = "" #HTML in gradio components doesnt do css and js properly so nned to highlight
|
529 |
|
530 |
doc = nlp(text)
|
531 |
iIDNumber = 0
|
|
|
540 |
for token in doc:
|
541 |
if (token.pos_ == "VERB") or (token.pos_ == "AUX"):
|
542 |
HTMLMainbody = HTMLMainbody + "<button id='btn" + str(iVerbCount) + "' onclick=HighlightWord('btn" + str(iVerbCount) + "')> " + token.text + "</button> "
|
543 |
+
GradHTMLMainbody = GradHTMLMainbody + "<button id='btn" + str(iVerbCount) + "' style='background-color: green;' onclick=HighlightWord('btn" + str(iVerbCount) + "')> " + token.text + "</button> "
|
544 |
allverbids = allverbids + str(iVerbCount) + " "
|
545 |
iVerbCount += 1
|
546 |
iWords += 1
|
547 |
allverbs = allverbs + token.text + " "
|
548 |
elif token.pos_ == "NOUN":
|
549 |
+
HTMLMainbody = HTMLMainbody + "<label class='Nouns' id='lbl" + token.text + "'>" + token.text + " </label>"
|
550 |
+
GradHTMLMainbody = GradHTMLMainbody + "<label class='Nouns' id='lbl" + token.text + "' style='background-color: blue;'>" + token.text + " </label>"
|
551 |
iNounCount += 1
|
552 |
iWords += 1
|
553 |
elif token.pos_ == "PUNCT":
|
554 |
HTMLMainbody = HTMLMainbody + token.text
|
555 |
+
GradHTMLMainbody = GradHTMLMainbody + token.text
|
556 |
else:
|
557 |
HTMLMainbody = HTMLMainbody + token.text + " "
|
558 |
+
GradHTMLMainbody = GradHTMLMainbody + token.text + " "
|
559 |
iWords += 1
|
560 |
iIDNumber += 1
|
561 |
|
|
|
563 |
allverbidslist = allverbids.split()
|
564 |
|
565 |
FinalHTML = ""
|
566 |
+
FinalGradHTML = ""
|
567 |
FinalCSS = ""
|
568 |
FinalJS = ""
|
569 |
|
|
|
630 |
}
|
631 |
'''
|
632 |
|
633 |
+
FinalGradHTML = FinalHTML + "\n<div><hr>\n" + GradHTMLMainbody + "\n" #HTML in gradio components doesnt do css and js properly so nned to highlight
|
634 |
FinalHTML = FinalHTML + "\n<div><hr>\n" + HTMLMainbody + "\n"
|
635 |
+
|
636 |
#FinalHTML = FinalHTML + '''</div><hr>
|
637 |
#<button onclick=OnlyUnknownSentences() id="btnOnlyUnknownSentences">Only Unknown Sentences Put this function in a timer to keep up to date without input</button>
|
638 |
#'''
|
|
|
661 |
\n
|
662 |
'''
|
663 |
|
664 |
+
FinalGradHTML = FinalGradHTML + '''<br><hr><br>
|
665 |
+
<div id='PD2'> Only Unknown List</div>
|
666 |
+
\n
|
667 |
+
'''
|
668 |
+
|
669 |
FinalOutput = FinalHTML + FinalCSS + FinalJS
|
670 |
+
FinalGradOutput = FinalGradHTML + FinalCSS + FinalJS
|
671 |
+
|
672 |
|
673 |
HTMLDownloadTemp = f'UnknownVerbTrack.html'
|
674 |
|
675 |
with open(HTMLDownloadTemp, 'w') as f:
|
676 |
f.write(FinalOutput)
|
677 |
|
678 |
+
return HTMLDownloadTemp, FinalGradOutput, FinalOutput
|
679 |
|
680 |
#Kathryn Lingel - Pyambic Pentameter Example - PyCon US
|
681 |
#Basic Language Model Code
|
|
|
809 |
|
810 |
#-------------------------------------------------------------------------------------------------------------------------------
|
811 |
|
812 |
+
def ImageTranslationTest(video, subtitle):
|
813 |
+
#Inputs from file Returns a <tempfile._TemporaryFileWrapper object at ___> so the path is item.name
|
814 |
|
815 |
+
if subtitle is None:
|
816 |
+
return video.name
|
817 |
|
818 |
+
return [video.name, subtitle.name]
|
819 |
|
820 |
+
#------------------------------------------------------------------------------------------------------------------------------
|
|
|
821 |
|
822 |
def AutoSyllablePractice(String):
|
823 |
FinalOutput = ""
|
|
|
946 |
|
947 |
return FinalOutput
|
948 |
|
949 |
+
|
950 |
+
def create_acronym_map(text):
|
951 |
+
"""Create an acronym map from the provided text."""
|
952 |
+
lines = text.split('\n')
|
953 |
+
acronym_map = {}
|
954 |
+
allacronyms = ""
|
955 |
+
|
956 |
+
for line in lines:
|
957 |
+
# Remove any special characters and split by whitespace
|
958 |
+
words = line.split()
|
959 |
+
acronym = ''.join([word[0].upper() for word in words if word])
|
960 |
+
if acronym: # Avoid adding empty lines
|
961 |
+
acronym_map[line] = acronym
|
962 |
+
allacronyms += acronym + " | "
|
963 |
+
|
964 |
+
return acronym_map, allacronyms
|
965 |
+
|
966 |
+
def onlyplurals(Inputtext): #NLP or Simple Suffix check
|
967 |
+
doc = nlp(Inputtext)
|
968 |
+
Pluralwords = ""
|
969 |
+
for token in doc:
|
970 |
+
if token.tag_ == "NNS" or token.tag_ == "NNPS":
|
971 |
+
Pluralwords = Pluralwords + token.text + " "
|
972 |
+
TextToks = Pluralwords.split(' ')
|
973 |
+
PluralCounts = Counter(elem for elem in TextToks)
|
974 |
+
return Pluralwords, PluralCounts
|
975 |
+
|
976 |
+
def LoadNLTKUDHRText(text):
|
977 |
+
NLTKtext = nltk.corpus.udhr.raw(text)
|
978 |
+
CountNLTKText = Counter(NLTKtext.split()).most_common(100)
|
979 |
+
|
980 |
+
return CountNLTKText, NLTKtext
|
981 |
+
|
982 |
+
NLTKudhr = gr.Dropdown(choices=['English-Latin1', 'Akuapem_Twi-UTF8', 'Zulu-Latin1', 'Afrikaans-Latin1', 'German_Deutsch-Latin1', 'Japanese_Nihongo-EUC', 'Japanese_Nihongo-SJIS', 'Japanese_Nihongo-UTF8', 'Spanish-Latin1', 'Korean_Hankuko-UTF8', 'Chinese_Mandarin-GB2312', 'Abkhaz-Cyrillic+Abkh', 'Abkhaz-UTF8', 'Achehnese-Latin1', 'Achuar-Shiwiar-Latin1', 'Adja-UTF8', 'Afaan_Oromo_Oromiffa-Latin1', 'Afrikaans-Latin1', 'Aguaruna-Latin1', 'Akuapem_Twi-UTF8', 'Albanian_Shqip-Latin1', 'Amahuaca', 'Amahuaca-Latin1', 'Amarakaeri-Latin1', 'Amuesha-Yanesha-UTF8', 'Arabela-Latin1', 'Arabic_Alarabia-Arabic', 'Asante-UTF8', 'Ashaninca-Latin1', 'Asheninca-Latin1', 'Asturian_Bable-Latin1', 'Aymara-Latin1', 'Balinese-Latin1', 'Bambara-UTF8', 'Baoule-UTF8', 'Basque_Euskara-Latin1', 'Batonu_Bariba-UTF8', 'Belorus_Belaruski-Cyrillic', 'Belorus_Belaruski-UTF8', 'Bemba-Latin1', 'Bengali-UTF8', 'Beti-UTF8', 'Bichelamar-Latin1', 'Bikol_Bicolano-Latin1', 'Bora-Latin1', 'Bosnian_Bosanski-Cyrillic', 'Bosnian_Bosanski-Latin2', 'Bosnian_Bosanski-UTF8', 'Breton-Latin1', 'Bugisnese-Latin1', 'Bulgarian_Balgarski-Cyrillic', 'Bulgarian_Balgarski-UTF8', 'Cakchiquel-Latin1', 'Campa_Pajonalino-Latin1', 'Candoshi-Shapra-Latin1', 'Caquinte-Latin1', 'Cashibo-Cacataibo-Latin1', 'Cashinahua-Latin1', 'Catalan-Latin1', 'Catalan_Catala-Latin1', 'Cebuano-Latin1', 'Chamorro-Latin1', 'Chayahuita-Latin1', 'Chechewa_Nyanja-Latin1', 'Chickasaw-Latin1', 'Chinanteco-Ajitlan-Latin1', 'Chinanteco-UTF8', 'Chinese_Mandarin-GB2312', 'Chuuk_Trukese-Latin1', 'Cokwe-Latin1', 'Corsican-Latin1', 'Croatian_Hrvatski-Latin2', 'Czech-Latin2', 'Czech-UTF8', 'Czech_Cesky-Latin2', 'Czech_Cesky-UTF8', 'Dagaare-UTF8', 'Dagbani-UTF8', 'Dangme-UTF8', 'Danish_Dansk-Latin1', 'Dendi-UTF8', 'Ditammari-UTF8', 'Dutch_Nederlands-Latin1', 'Edo-Latin1', 'English-Latin1', 'Esperanto-UTF8', 'Estonian_Eesti-Latin1', 'Ewe_Eve-UTF8', 'Fante-UTF8', 'Faroese-Latin1', 'Farsi_Persian-UTF8', 'Farsi_Persian-v2-UTF8', 'Fijian-Latin1', 'Filipino_Tagalog-Latin1', 'Finnish_Suomi-Latin1', 'Fon-UTF8', 'French_Francais-Latin1', 'Frisian-Latin1', 'Friulian_Friulano-Latin1', 'Ga-UTF8', 'Gagauz_Gagauzi-UTF8', 'Galician_Galego-Latin1', 'Garifuna_Garifuna-Latin1', 'German_Deutsch-Latin1', 'Gonja-UTF8', 'Greek_Ellinika-Greek', 'Greek_Ellinika-UTF8', 'Greenlandic_Inuktikut-Latin1', 'Guarani-Latin1', 'Guen_Mina-UTF8', 'HaitianCreole_Kreyol-Latin1', 'HaitianCreole_Popular-Latin1', 'Hani-Latin1', 'Hausa_Haoussa-Latin1', 'Hawaiian-UTF8', 'Hebrew_Ivrit-Hebrew', 'Hebrew_Ivrit-UTF8', 'Hiligaynon-Latin1', 'Hindi-UTF8', 'Hindi_web-UTF8', 'Hmong_Miao-Sichuan-Guizhou-Yunnan-Latin1', 'Hmong_Miao-SouthernEast-Guizhou-Latin1', 'Hmong_Miao_Northern-East-Guizhou-Latin1', 'Hrvatski_Croatian-Latin2', 'Huasteco-Latin1', 'Huitoto_Murui-Latin1', 'Hungarian_Magyar-Latin1', 'Hungarian_Magyar-Latin2', 'Hungarian_Magyar-UTF8', 'Ibibio_Efik-Latin1', 'Icelandic_Yslenska-Latin1', 'Ido-Latin1', 'Igbo-UTF8', 'Iloko_Ilocano-Latin1', 'Indonesian-Latin1', 'Interlingua-Latin1', 'Inuktikut_Greenlandic-Latin1', 'IrishGaelic_Gaeilge-Latin1', 'Italian-Latin1', 'Italian_Italiano-Latin1', 'Japanese_Nihongo-EUC', 'Japanese_Nihongo-SJIS', 'Japanese_Nihongo-UTF8', 'Javanese-Latin1', 'Jola-Fogny_Diola-UTF8', 'Kabye-UTF8', 'Kannada-UTF8', 'Kaonde-Latin1', 'Kapampangan-Latin1', 'Kasem-UTF8', 'Kazakh-Cyrillic', 'Kazakh-UTF8', 'Kiche_Quiche-Latin1', 'Kicongo-Latin1', 'Kimbundu_Mbundu-Latin1', 'Kinyamwezi_Nyamwezi-Latin1', 'Kinyarwanda-Latin1', 'Kituba-Latin1', 'Korean_Hankuko-UTF8', 'Kpelewo-UTF8', 'Krio-UTF8', 'Kurdish-UTF8', 'Lamnso_Lam-nso-UTF8', 'Latin_Latina-Latin1', 'Latin_Latina-v2-Latin1', 'Latvian-Latin1', 'Limba-UTF8', 'Lingala-Latin1', 'Lithuanian_Lietuviskai-Baltic', 'Lozi-Latin1', 'Luba-Kasai_Tshiluba-Latin1', 'Luganda_Ganda-Latin1', 'Lunda_Chokwe-lunda-Latin1', 'Luvale-Latin1', 'Luxembourgish_Letzebuergeusch-Latin1', 'Macedonian-UTF8', 'Madurese-Latin1', 'Makonde-Latin1', 'Malagasy-Latin1', 'Malay_BahasaMelayu-Latin1', 'Maltese-UTF8', 'Mam-Latin1', 'Maninka-UTF8', 'Maori-Latin1', 'Mapudungun_Mapuzgun-Latin1', 'Mapudungun_Mapuzgun-UTF8', 'Marshallese-Latin1', 'Matses-Latin1', 'Mayan_Yucateco-Latin1', 'Mazahua_Jnatrjo-UTF8', 'Mazateco-Latin1', 'Mende-UTF8', 'Mikmaq_Micmac-Mikmaq-Latin1', 'Minangkabau-Latin1', 'Miskito_Miskito-Latin1', 'Mixteco-Latin1', 'Mongolian_Khalkha-Cyrillic', 'Mongolian_Khalkha-UTF8', 'Moore_More-UTF8', 'Nahuatl-Latin1', 'Ndebele-Latin1', 'Nepali-UTF8', 'Ngangela_Nyemba-Latin1', 'NigerianPidginEnglish-Latin1', 'Nomatsiguenga-Latin1', 'NorthernSotho_Pedi-Sepedi-Latin1', 'Norwegian-Latin1', 'Norwegian_Norsk-Bokmal-Latin1', 'Norwegian_Norsk-Nynorsk-Latin1', 'Nyanja_Chechewa-Latin1', 'Nyanja_Chinyanja-Latin1', 'Nzema-UTF8', 'OccitanAuvergnat-Latin1', 'OccitanLanguedocien-Latin1', 'Oromiffa_AfaanOromo-Latin1', 'Osetin_Ossetian-UTF8', 'Oshiwambo_Ndonga-Latin1', 'Otomi_Nahnu-Latin1', 'Paez-Latin1', 'Palauan-Latin1', 'Peuhl-UTF8', 'Picard-Latin1', 'Pipil-Latin1', 'Polish-Latin2', 'Polish_Polski-Latin2', 'Ponapean-Latin1', 'Portuguese_Portugues-Latin1', 'Pulaar-UTF8', 'Punjabi_Panjabi-UTF8', 'Purhepecha-UTF8', 'Qechi_Kekchi-Latin1', 'Quechua-Latin1', 'Quichua-Latin1', 'Rarotongan_MaoriCookIslands-Latin1', 'Rhaeto-Romance_Rumantsch-Latin1', 'Romani-Latin1', 'Romani-UTF8', 'Romanian-Latin2', 'Romanian_Romana-Latin2', 'Rukonzo_Konjo-Latin1', 'Rundi_Kirundi-Latin1', 'Runyankore-rukiga_Nkore-kiga-Latin1', 'Russian-Cyrillic', 'Russian-UTF8', 'Russian_Russky-Cyrillic', 'Russian_Russky-UTF8', 'Sami_Lappish-UTF8', 'Sammarinese-Latin1', 'Samoan-Latin1', 'Sango_Sangho-Latin1', 'Sanskrit-UTF8', 'Saraiki-UTF8', 'Sardinian-Latin1', 'ScottishGaelic_GaidhligAlbanach-Latin1', 'Seereer-UTF8', 'Serbian_Srpski-Cyrillic', 'Serbian_Srpski-Latin2', 'Serbian_Srpski-UTF8', 'Sharanahua-Latin1', 'Shipibo-Conibo-Latin1', 'Shona-Latin1', 'Sinhala-UTF8', 'Siswati-Latin1', 'Slovak-Latin2', 'Slovak_Slovencina-Latin2', 'Slovenian_Slovenscina-Latin2', 'SolomonsPidgin_Pijin-Latin1', 'Somali-Latin1', 'Soninke_Soninkanxaane-UTF8', 'Sorbian-Latin2', 'SouthernSotho_Sotho-Sesotho-Sutu-Sesutu-Latin1', 'Spanish-Latin1', 'Spanish_Espanol-Latin1', 'Sukuma-Latin1', 'Sundanese-Latin1', 'Sussu_Soussou-Sosso-Soso-Susu-UTF8', 'Swaheli-Latin1', 'Swahili_Kiswahili-Latin1', 'Swedish_Svenska-Latin1', 'Tahitian-UTF8', 'Tenek_Huasteco-Latin1', 'Tetum-Latin1', 'Themne_Temne-UTF8', 'Tiv-Latin1', 'Toba-UTF8', 'Tojol-abal-Latin1', 'TokPisin-Latin1', 'Tonga-Latin1', 'Tongan_Tonga-Latin1', 'Totonaco-Latin1', 'Trukese_Chuuk-Latin1', 'Turkish_Turkce-Turkish', 'Turkish_Turkce-UTF8', 'Tzeltal-Latin1', 'Tzotzil-Latin1', 'Uighur_Uyghur-Latin1', 'Uighur_Uyghur-UTF8', 'Ukrainian-Cyrillic', 'Ukrainian-UTF8', 'Umbundu-Latin1', 'Urarina-Latin1', 'Uzbek-Latin1', 'Vietnamese-ALRN-UTF8', 'Vietnamese-UTF8', 'Vlach-Latin1', 'Walloon_Wallon-Latin1', 'Wama-UTF8', 'Waray-Latin1', 'Wayuu-Latin1', 'Welsh_Cymraeg-Latin1', 'WesternSotho_Tswana-Setswana-Latin1', 'Wolof-Latin1', 'Xhosa-Latin1', 'Yagua-Latin1', 'Yao-Latin1', 'Yapese-Latin1', 'Yoruba-UTF8', 'Zapoteco-Latin1', 'Zapoteco-SanLucasQuiavini-Latin1', 'Zhuang-Latin1', 'Zulu-Latin1'], label="Choose one the below languages")
|
983 |
+
|
984 |
+
def SimultaneousSpellingPrac(text):
|
985 |
+
TextToks = text.split()
|
986 |
+
FinalOutput = "For Sentences wrap in another function that calls function per sentences (Spacy) \n"
|
987 |
+
|
988 |
+
iLongestWord = 0
|
989 |
+
for tok in TextToks:
|
990 |
+
if len(tok) > iLongestWord: iLongestWord = len(tok)
|
991 |
+
|
992 |
+
Equaltok = ""
|
993 |
+
for tok in TextToks:
|
994 |
+
Equaltok = Equaltok + tok.ljust(iLongestWord, '0') + " " #https://stackoverflow.com/questions/23216512/python-make-string-equal-length
|
995 |
+
|
996 |
+
SimulList = []
|
997 |
+
for i in range(0, iLongestWord):
|
998 |
+
for tok in Equaltok.split():
|
999 |
+
SimulList.append(tok[i])
|
1000 |
+
|
1001 |
+
iWordSpaces = 0
|
1002 |
+
ZerosFinalOutput = ""
|
1003 |
+
|
1004 |
+
for item in SimulList:
|
1005 |
+
iWordSpaces += 1
|
1006 |
+
ZerosFinalOutput = ZerosFinalOutput + item
|
1007 |
+
if iWordSpaces == len(TextToks):
|
1008 |
+
ZerosFinalOutput = ZerosFinalOutput + " "
|
1009 |
+
iWordSpaces = 0
|
1010 |
+
|
1011 |
+
FinalOutput = FinalOutput + ZerosFinalOutput + " \n\n" + ZerosFinalOutput.replace("0", "") + " \n\n" + str(iLongestWord)
|
1012 |
+
return FinalOutput
|
1013 |
+
|
1014 |
+
def FirstLetterSummary(Text):
|
1015 |
+
TextToks = Text.split(" ")
|
1016 |
+
FinalOutput = ''
|
1017 |
+
for tok in TextToks:
|
1018 |
+
FinalOutput = FinalOutput + tok[0] + " "
|
1019 |
+
|
1020 |
+
WordSuggestLetters = FinalOutput.replace(" ","")
|
1021 |
+
WordSuggestToks = [(WordSuggestLetters[i:i+5]) for i in range(0, len(WordSuggestLetters), 5)]
|
1022 |
+
WordsSuggest = ""
|
1023 |
+
|
1024 |
+
for text in WordSuggestToks:
|
1025 |
+
WordsSuggest = WordsSuggest + " " + text
|
1026 |
+
|
1027 |
+
return FinalOutput, WordsSuggest
|
1028 |
+
|
1029 |
+
#-------
|
1030 |
+
|
1031 |
+
def imagebasedreading(inputtext):
|
1032 |
+
# Read the user input text file
|
1033 |
+
#with open("inputtext.txt", "r", encoding="utf-8") as file:
|
1034 |
+
# inputtext = file.read()
|
1035 |
+
|
1036 |
+
inputtextlines = inputtext.splitlines()
|
1037 |
+
|
1038 |
+
htmlpart1 = """
|
1039 |
+
<!DOCTYPE html>
|
1040 |
+
<html>
|
1041 |
+
<head>
|
1042 |
+
<title>Image Placeholder with Text Background</title>
|
1043 |
+
<style>
|
1044 |
+
.grid-container {
|
1045 |
+
display: grid;
|
1046 |
+
grid-template-columns: repeat(4, 1fr);
|
1047 |
+
gap: 16px;
|
1048 |
+
}
|
1049 |
+
.image-container {
|
1050 |
+
width: 300px;
|
1051 |
+
height: 300px;
|
1052 |
+
margin: 10px;
|
1053 |
+
border: 1px solid black;
|
1054 |
+
}
|
1055 |
+
img {
|
1056 |
+
width: 100%;
|
1057 |
+
height: 100%;
|
1058 |
+
}
|
1059 |
+
</style>
|
1060 |
+
</head>
|
1061 |
+
<body>
|
1062 |
+
<button onclick="saveState()">Save State</button>
|
1063 |
+
<button onclick="saveFilePaths()">Save File Paths</button>
|
1064 |
+
<input type="file" id="loadStateFile" onchange="loadState(event)">
|
1065 |
+
<button onclick="updateCounter()">Update Counter</button>
|
1066 |
+
<label id="counterLabel">0 / """ + str(len(inputtextlines)) + """ images complete</label>
|
1067 |
+
<div class="grid-container">
|
1068 |
+
"""
|
1069 |
+
|
1070 |
+
htmlpart2 = """
|
1071 |
+
</div>
|
1072 |
+
|
1073 |
+
<script>
|
1074 |
+
|
1075 |
+
function clearState() {
|
1076 |
+
const imageContainers = document.querySelectorAll(".image-container img");
|
1077 |
+
imageContainers.forEach((img) => {
|
1078 |
+
img.src = "";
|
1079 |
+
});
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
|
1083 |
+
let filePaths = {};
|
1084 |
+
|
1085 |
+
function loadImage(idx) {
|
1086 |
+
const fileInput = document.getElementById("fileInput" + idx);
|
1087 |
+
const image = document.getElementById("image" + idx);
|
1088 |
+
const file = fileInput.files[0];
|
1089 |
+
const reader = new FileReader();
|
1090 |
+
|
1091 |
+
reader.addEventListener("load", function () {
|
1092 |
+
image.src = reader.result;
|
1093 |
+
filePaths["image" + idx] = file.name;
|
1094 |
+
updateCounter();
|
1095 |
+
}, false);
|
1096 |
+
|
1097 |
+
if (file) {
|
1098 |
+
reader.readAsDataURL(file);
|
1099 |
+
}
|
1100 |
+
}
|
1101 |
+
|
1102 |
+
function saveState() {
|
1103 |
+
let state = {};
|
1104 |
+
const imageContainers = document.querySelectorAll(".image-container img");
|
1105 |
+
imageContainers.forEach((img, idx) => {
|
1106 |
+
if (img.src && img.src !== window.location.href) {
|
1107 |
+
state["image" + idx] = img.src;
|
1108 |
+
}
|
1109 |
+
});
|
1110 |
+
|
1111 |
+
const blob = new Blob([JSON.stringify(state)], { type: 'text/plain' });
|
1112 |
+
const a = document.createElement('a');
|
1113 |
+
a.href = URL.createObjectURL(blob);
|
1114 |
+
a.download = 'image_state.txt';
|
1115 |
+
a.click();
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
function saveFilePaths() {
|
1119 |
+
const blob = new Blob([JSON.stringify(filePaths)], { type: 'text/plain' });
|
1120 |
+
const a = document.createElement('a');
|
1121 |
+
a.href = URL.createObjectURL(blob);
|
1122 |
+
a.download = 'file_paths.txt';
|
1123 |
+
a.click();
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
function loadState(event) {
|
1127 |
+
clearState(); // Clear existing state
|
1128 |
+
|
1129 |
+
const file = event.target.files[0];
|
1130 |
+
if (file) {
|
1131 |
+
const reader = new FileReader();
|
1132 |
+
reader.onload = function(e) {
|
1133 |
+
const state = JSON.parse(e.target.result);
|
1134 |
+
for (const [key, value] of Object.entries(state)) {
|
1135 |
+
const image = document.getElementById(key);
|
1136 |
+
if (image) {
|
1137 |
+
image.src = value;
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
+
};
|
1141 |
+
reader.readAsText(file);
|
1142 |
+
}
|
1143 |
+
}
|
1144 |
+
|
1145 |
+
function updateCounter() {
|
1146 |
+
const totalPlaceholders = document.querySelectorAll(".image-container").length;
|
1147 |
+
let loadedImages = 0;
|
1148 |
+
|
1149 |
+
const imageContainers = document.querySelectorAll(".image-container img");
|
1150 |
+
imageContainers.forEach((img) => {
|
1151 |
+
if (img.src && img.src !== window.location.href) {
|
1152 |
+
loadedImages += 1;
|
1153 |
+
}
|
1154 |
+
});
|
1155 |
+
|
1156 |
+
document.getElementById("counterLabel").innerText = loadedImages + " / " + totalPlaceholders + " images complete";
|
1157 |
+
}
|
1158 |
+
</script>
|
1159 |
+
|
1160 |
+
</body>
|
1161 |
+
</html>
|
1162 |
+
"""
|
1163 |
+
|
1164 |
+
#If you have a gpu and imagepipeline then src in img tag = filepath of generate image
|
1165 |
+
def generate_html(textlines):
|
1166 |
+
num_containers = len(textlines)
|
1167 |
+
html_string = ""
|
1168 |
+
for i in range(num_containers):
|
1169 |
+
container = f'''
|
1170 |
+
<div class="image-container">
|
1171 |
+
<input type="file" id="fileInput{i}" onchange="loadImage({i})">
|
1172 |
+
<img id="image{i}" src="" alt="{textlines[i]} - Placeholder {i + 1}" onerror="this.style.background = 'grey url(data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 100 100\'><text y=\'.9em\' font-size=\'90\'>Placeholder {i + 1}</text></svg>) no-repeat center; this.style.border = \'1px solid black\';">
|
1173 |
+
</div>
|
1174 |
+
'''
|
1175 |
+
html_string += container
|
1176 |
+
return html_string
|
1177 |
+
|
1178 |
+
# Generate the HTML based on the number of lines
|
1179 |
+
output_html = htmlpart1 + "\n" + generate_html(inputtextlines) + "\n" + htmlpart2
|
1180 |
+
|
1181 |
+
# Save the generated HTML
|
1182 |
+
now = datetime.datetime.now()
|
1183 |
+
filename = f"ImagePlaceholder{now.strftime('%Y-%m-%d_%H-%M')}_{inputtext[:16]}.html"
|
1184 |
+
with open(filename, "w", encoding="utf-8") as file:
|
1185 |
+
file.write(output_html)
|
1186 |
+
|
1187 |
+
return filename, output_html, output_html
|
1188 |
+
|
1189 |
+
#--------
|
1190 |
+
|
1191 |
guidedreadingseperator = gr.Dropdown(choices=[".", ",", "lines", "Sentences"], value=".", interactive=True)
|
1192 |
textspreprocess = [
|
1193 |
["Bing created this example \nApple is looking at buying U.K. startup for $1 billion \nApple schaut sich für 1 Milliarde Dollar ein Startup aus Großbritannien an \nApple está mirando comprar una startup del Reino Unido por mil millones de dólares \n애플은 영국의 스타트업을 10억 달러에 사려고 한다 \nアップルは、英国のスタートアップを10億ドルで買収する予定だ \n苹果正考虑以10亿美元收购英国初创公司", "\n"]
|
|
|
1195 |
|
1196 |
LLPromptIdeas = """
|
1197 |
|
1198 |
+
Lets try this I will give you the english word and you find the <<chinese>> word and then mix the meaning of the word with the mnemonic
|
1199 |
|
1200 |
Bings Explanation
|
1201 |
Youre welcome. Im happy to help. If I wanted to explain the rules of this game clearly and concisely, I would do something like this:
|
|
|
1208 |
|
1209 |
<hr>
|
1210 |
|
1211 |
+
Make jokes while following rules for a syllogism jokes game:
|
1212 |
|
1213 |
The game can be played with any number of people.
|
1214 |
One person starts by stating a syllogism, which is a logical argument that consists of three parts: a major premise, a minor premise, and a conclusion.
|
|
|
1238 |
|
1239 |
"""
|
1240 |
|
1241 |
+
LLPromptIdeasasbtns = LLPromptIdeas.split("<hr>")
|
1242 |
+
|
1243 |
+
def loadforcopybuttonllmpromptideas():
|
1244 |
+
global LLPromptIdeasasbtns
|
1245 |
+
list = LLPromptIdeasasbtns
|
1246 |
+
return "Load the examples with the button below, Alternatively copy paste manually above", list[0], list[1], list[2], list[3], list[4]
|
1247 |
+
|
1248 |
def display_website(link):
|
1249 |
html = f"<iframe src='{link}' width='100%' height='1000px'></iframe>"
|
1250 |
+
gr.Info("If 404 then the space/page has probably been disabled - normally due to a better alternative")
|
1251 |
return html
|
1252 |
|
1253 |
+
def RepititionPracticeTimeCalculator(text, reps_per_item, seconds_per_item):
|
1254 |
+
textlines = text.splitlines()
|
1255 |
+
lines = len(textlines)
|
1256 |
+
FinalOutput = f"Total Time is estimated: { lines * reps_per_item * seconds_per_item / 60 } minutes ( {lines} lines)"
|
1257 |
+
return FinalOutput
|
1258 |
+
|
1259 |
|
1260 |
randomExposuremessageText = ["Great Test for LLM function calling (with Gradio Client)", "Unknown Tracker Tab = Incomplete Reading Assistant Idea - HTML app based on text to be read", "Bing mnemonic - lost = dont ignore unusual sounds here inside lost cave", "1000 verbs in lists of 100, verbs = easy setence structure estimation (SVO, SOV, etc.)", "Can put any message here in the navigatoin tab"]
|
1261 |
|
|
|
1265 |
#randomExposuremessagelistitem2 = str(random.sample(randomExposuremessageText, 1)).replace("['", "").replace("']", "")
|
1266 |
return f" <marquee> { randomExposuremessagelistitem } </marquee> "
|
1267 |
|
1268 |
+
def TabNavigation():
|
1269 |
+
return gr.Tabs.update(selected=1) #, tabs1=nav1)
|
1270 |
+
|
1271 |
+
def segment_video_with_opencv(file_path, segment_duration=60):
|
1272 |
+
# Open the video file
|
1273 |
+
cap = cv2.VideoCapture(file_path.name)
|
1274 |
+
|
1275 |
+
# Get video properties
|
1276 |
+
fps = int(cap.get(cv2.CAP_PROP_FPS))
|
1277 |
+
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
1278 |
+
|
1279 |
+
# Calculate total segments required
|
1280 |
+
total_segments = math.ceil(total_frames / (fps * segment_duration))
|
1281 |
+
|
1282 |
+
# List to store the file paths of the generated chunks
|
1283 |
+
generated_files = []
|
1284 |
+
|
1285 |
+
for segment in range(total_segments):
|
1286 |
+
# Define the codec and create VideoWriter object
|
1287 |
+
# For .mp4 output, use the H.264 codec with the tag 'mp4v'
|
1288 |
+
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
1289 |
+
output_filename = f'chunk_{segment}.mp4'
|
1290 |
+
out = cv2.VideoWriter(output_filename, fourcc, fps, (int(cap.get(3)), int(cap.get(4))))
|
1291 |
+
|
1292 |
+
for frame_num in range(fps * segment_duration):
|
1293 |
+
ret, frame = cap.read()
|
1294 |
+
if ret:
|
1295 |
+
out.write(frame)
|
1296 |
+
else:
|
1297 |
+
break
|
1298 |
+
out.release()
|
1299 |
+
|
1300 |
+
# Append the file path of the generated chunk to the list
|
1301 |
+
generated_files.append(output_filename)
|
1302 |
+
|
1303 |
+
cap.release()
|
1304 |
+
|
1305 |
+
return generated_files
|
1306 |
+
|
1307 |
+
# For testing purposes
|
1308 |
+
# file_paths = segment_video_with_opencv("path_to_your_video.mp4")
|
1309 |
+
# print(file_paths)
|
1310 |
+
|
1311 |
|
1312 |
# Define the Gradio interface inputs and outputs for video split
|
1313 |
spvvideo_file_input = gr.File(label='Video File')
|
|
|
1325 |
randomExposuremessage2 = randommarquee()
|
1326 |
|
1327 |
VideoTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
|
1328 |
+
VideoTestSubtitleInput = gr.File(label="select a subtitle file", file_types=[".txt", ".srt", ".vtt"])
|
1329 |
+
VideoSplitTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
|
1330 |
|
1331 |
with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', secondary_hue='red', neutral_hue='blue', )
|
1332 |
+
gr.HTML('<div style="display: flex; justify-content: center; align-items: center; height: 100%;"> ---- Under Construction: Very Slowly figuring out what AI intergrated interface means (Chat vs Forms vs Function calling vs Sensor + Trigger vs Agent) | How to end copy paste once and for all? ---- </div> <div style="display: flex; justify-content: center; align-items: center; height: 100%;"> All the apis from the below space need to be treated like RAG as notes for the LLM to read before providing its answer </div>')
|
1333 |
+
with gr.Accordion("LLM HF Spaces (Click Here to Open) - Use 'Acronym Map Creation Space' Tab with this - Ask for Translation of image tags made below, sentence to emojis, Wordlists, Test Conversations, Get Grammar Explanations etc., Can use GPT-4 or new SOTA to review the conversation", open=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1334 |
with gr.Row():
|
1335 |
+
linktochat = gr.Dropdown(choices=["https://sdk.vercel.ai/docs", "https://labs.perplexity.ai/", "https://chat.lmsys.org", "https://huggingfaceh4-zephyr-chat.hf.space", "https://osanseviero-mistral-super-fast.hf.space", "https://artificialguybr-qwen-14b-chat-demo.hf.space", "https://huggingface-projects-llama-2-7b-chat.hf.space", "https://ysharma-explore-llamav2-with-tgi.hf.space", "https://mosaicml-mpt-30b-chat.hf.space", "https://huggingfaceh4-falcon-chat.hf.space", "https://uwnlp-guanaco-playground-tgi.hf.space", "https://stabilityai-stablelm-tuned-alpha-chat.hf.space", "https://mosaicml-mpt-7b-storywriter.hf.space", "https://huggingfaceh4-starchat-playground.hf.space", "https://bigcode-bigcode-playground.hf.space", "https://mosaicml-mpt-7b-chat.hf.space", "https://huggingchat-chat-ui.hf.space", "https://togethercomputer-openchatkit.hf.space"], label="Choose/Cancel type any .hf.space link here (can also type a link)'", allow_custom_value=True)
|
1336 |
chatspacebtn = gr.Button("Use the chosen URL to load interface with a chat model. For sdk.vercel click the chat button on the top left")
|
1337 |
+
with gr.Accordion("Some prompt ideas", open=False):
|
1338 |
+
with gr.Accordion("Prompts in text (Manual copy paste)", open=False):
|
1339 |
+
gr.HTML(LLPromptIdeas)
|
1340 |
+
gr.Interface(loadforcopybuttonllmpromptideas, inputs=None, outputs=["html", "code", "code", "code", "code", "code"])
|
1341 |
+
chatspace = gr.HTML("Chat Space Chosen will load here")
|
1342 |
+
chatspacebtn.click(display_website, inputs=linktochat, outputs=chatspace)
|
1343 |
+
gr.HTML("<div style='display: flex; justify-content: center; align-items: center; height: 100%;'><a href='https://github.com/KillianLucas/open-interpreter'> -- Open Interpreter = Function Calling Killer = (Almost) All functions are now just prompt engineering away from existing = Modding any app in the world especially games = custom learning environments -- </a> | </div>")
|
1344 |
with gr.Row():
|
1345 |
with gr.Column(scale=1):
|
1346 |
+
with gr.Tabs() as nav1:
|
1347 |
+
with gr.Tab("Rep - HTML"):
|
1348 |
+
gr.HTML("UNNWFWO = Unknown Native Word Foreign Word Order i.e. during active listening practice you only need the words you dont know")
|
1349 |
+
gr.HTML("""<iframe height="1200" style="width: 100%;" scrolling="no" title="Memorisation Aid" src="https://codepen.io/kwabs22/embed/GRXKQgj?default-tab=result&editable=true" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
|
1350 |
+
See the Pen <a href="https://codepen.io/kwabs22/pen/GRXKQgj"> Memorisation Aid</a> by kwabs22 (<a href="https://codepen.io/kwabs22">@kwabs22</a>) on <a href="https://codepen.io">CodePen</a>. </iframe>""")
|
1351 |
+
with gr.Tab("Rep - Gradio"):
|
1352 |
+
gr.Interface(fn=group_words, inputs=groupinput_text, outputs=groupoutput_text, description="Word Grouping and Rotation - Group a list of words into sets of 10 and rotate them every 60 seconds.") #.queue()
|
1353 |
+
with gr.Tab("Navigation"):
|
1354 |
+
gr.HTML("Primary goal of this space is to help with memorisation --> Two main forms read or listen (rewriting is also an option for mission critical information - acronym map (too time comsuming))")
|
1355 |
+
gr.HTML("Picture Annotation <br> Chorus Focused Word List <br> Merged Subtitles <br> Repetitive Audio (TTS) <br> Word and Sentence Jumbling <br> Unkown: Wordnet <br> Unknown: Wikipeadia <br>")
|
1356 |
+
PracticeExposureInput = gr.Textbox("", placeholder="Exposure practice = look up", label="Exposure at the top")
|
1357 |
+
PracticeExposurebtn = gr.Button("Change Default") #Button CLick is defined under the variable it needs to manipulate to avoid undefined error
|
1358 |
+
gr.Button("Tab Navigation").click(TabNavigation, inputs=None, outputs=[nav1])
|
1359 |
+
with gr.Tab("Words Lists"):
|
1360 |
+
gr.HTML("Stop, Sight(Dolch) and other Wordlists")
|
1361 |
+
gr.HTML("Wikipeadia <br> Basic: <a href='https://en.wikipedia.org/wiki/Dolch_word_list'> -- Dolch (Sight) Words -- </a> | <br> Advanced: <a href='https://en.wikipedia.org/wiki/Blend_word'> -- Blend Word -- </a> | <a href='https://en.wikipedia.org/wiki/List_of_portmanteaus'> -- List_of_portmanteaus -- </a> | ")
|
1362 |
+
gr.HTML("Reddit <br> <a href='https://www.reddit.com/r/wordplay/'> -- Wordplay -- </a> | ")
|
1363 |
+
gr.HTML("Language Tests <br> ")
|
1364 |
+
gr.HTML("Other <br> <a href='https://english.stackexchange.com/'> -- English (StackExchange) -- </a> | <a href='https://english.stackexchange.com/questions/572884/what-is-it-called-when-two-words-are-combined-by-overlapping-each-other'> -- Overlapping Blends (StackExchange) -- </a> | ")
|
1365 |
+
with gr.Tab("Vector Database = Memorisation"):
|
1366 |
+
gr.HTML("Phrasebook on demand in realtime <br><br> Open AI - 10000 * 1000tokens (+- 4000 characters) = 1$ (0.0001 per 1000 tokens / 750 words), Cohere Multilingual = free for personal use / Commercial use = \n Vector Database query = Better than text search but not for logical relationships")
|
1367 |
+
with gr.Tab("Time Estimate Calculator"):
|
1368 |
+
gr.HTML("Repitition = A subconcious time gaame - transparent screens + below repitition assist (Vision) or (Audio) ")
|
1369 |
+
gr.Interface(fn=RepititionPracticeTimeCalculator, inputs=["text", "number", "number"], outputs="text")
|
1370 |
with gr.Column(scale=3):
|
1371 |
+
with gr.Tab("Workflows"):
|
1372 |
+
gr.HTML("General Ideas in this space - Speed of Learning = Avoid Things you know like the plague -- How to track what you know -- Counter is easiest and How you feel is the hardest (The more you know, the more confusion on what you dont know as you probably werent keeping track) <br><br> Visulisation of long text - Bottom of this page <br> Wordlist - 1 new word at a time per minute in the space to the left <br> Youtube Video Watching - Subtitles Tab <br> Reading - Unknown Tracker Tabs <br> Longer Text Memorising - Acronym Map Creation Tab and Transition Tab <br> Brainstorming - Reading Assistant <br> Random Exposure <br> ")
|
1373 |
+
with gr.Row():
|
1374 |
+
PracticeExposure = gr.HTML(randomExposuremessage)
|
1375 |
+
PracticeExposure2 = gr.HTML(randomExposuremessage2)
|
1376 |
+
PracticeExposurebtn.click(fn=changeexposuretext, inputs=PracticeExposureInput, outputs=PracticeExposure)
|
1377 |
+
with gr.Row():
|
1378 |
+
with gr.Column(scale=1):
|
1379 |
+
gr.HTML("Advanced Repitition = Combinatorics --> to understand a sentence properly you need understanding of every word --> in language that means use with other words --> Combos within the unique words in a sentence, paragraph, page, etc. --> as close to 3 word sentences")
|
1380 |
+
with gr.Column(scale=1):
|
1381 |
+
gr.HTML("<p>Timing Practice - Repitition: Run from it, Dread it, Repitition is inevitable - Thanos --> Repitition of reaction - Foreign in eyes/ears native in mind (For beginners) | Repitition is a multitask activity like driving must be subconcious process to show mastery </p>")
|
1382 |
+
gr.HTML(""" <a href='https://github.com/eugeneyan/open-llms'> -- Opensource List -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard'> -- Open LLM Leaderboard -- </a> | <a href='https://huggingface.co/spaces/sanchit-gandhi/whisper-jax'> -- Whisper JAX -- </a> | <a href="https://translate.google.com/?hl=en&tab=TT"> -- Google Translate -- </a> | <a href='https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis'> -- Modelscope Text to Video -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion'> -- stable-diffusion 2 -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion-1'> -- stable-diffusion 1 -- </a> | <a href='https://huggingface.co/spaces/kakaobrain/karlo'> -- karlo 1 -- </a> | <a href='https://huggingface.co/spaces/suno/bark'> -- Bark (TTS) -- </a> | <a href='https://chat.lmsys.org/'> -- Offline Text Model Demos -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a> | <a href='https://beta.elevenlabs.io/'> -- Eleven Labs -- </a> | <a href='https://www.d-id.com/'> -- Animate an Image -- </a> | <a href='https://voice.ai/'> -- Clone a voice -- </a> | <a href='https://openai.com/pricing'> -- OpenAI pricing -- </a> | <a href='https://huggingface.co/spaces/sohojoe/soho-clip-embeddings-explorer'> -- Image Training Data Search -- </a> | <a href='https://huggingface.co/spaces/huggingchat/chat-ui'> -- Huggingface Chat -- </a> | <a href='https://huggingface.co/spaces/bguisard/stable-diffusion-nano'> -- 128x128 Stable Diffusion (Fast) -- </a> | <a href='https://huggingface.co/spaces/colonelwatch/abstracts-index'> -- Search 95 million research abstracts -- </a> | <a href='https://huggingface.co/datasets/roneneldan/TinyStories'> -- Tiny Stories Dataset -- </a> | <a href='https://huggingface.co/spaces/lykeven/visualglm-6b'> -- Visualglm6b - Discuss images -- </a> | <a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/camenduru/potat1'> -- Potat1 Text2vid -- </a> | <a href='https://twitter.com/willdepue/status/1661781355452325889'> -- Alexandria Prohect (Will Deque) - Free Embeddings -- </a> | <a href='https://artsandculture.google.com/'> -- Google Arts and Culture Portal -- </a> | <a href='https://huggingface.co/spaces/Matthijs/whisper_word_timestamps'> -- Word Level Timestamps -- </a> | <a href='https://huggingface.co/spaces/zaanind/NLLB-translation'> -- NLLB 600M Demo -- </a> = <a href='https://github.com/facebookresearch/fairseq/tree/nllb'> -- NLLB Github -- </a> | <a href='https://huggingface.co/spaces/hysts/zeroscope-v2'> -- Zeroscope v2 Text to video -- </a> | <a href='https://huggingface.co/spaces/SpacesExamples/ComfyUI'> -- ComfyUI Text to Image -- </a> | <a href='https://huggingface.co/spaces/DeepFloyd/IF'> -- Deepfloyd IF - Text in image -- </a> | <a href='https://huggingface.co/spaces/ysharma/ChatGPT-Plugins-in-Gradio'> -- ChatGPT Custom Plugins Test Space -- </a> | <a href='https://www.reddit.com/r/LocalLLaMA/'> -- r/LocalLlama -- </a> | <a href='https://www.reddit.com/r/singularity/'> -- r/Singularity -- </a> | <a href='https://huggingface.co/spaces/hysts/SD-XL'> -- SD-XL Test Space -- </a> | <a href='https://huggingface.co/spaces/facebook/seamless_m4t'> -- Seamless M4T - Translation one stop shop -- </a> | <a href='https://huggingface.co/spaces/codellama/codellama-playground'> -- Code Llama playground -- </a> | <a href='https://huggingface.co/spaces/Voicemod/Text-to-Sing'> -- Text to sing -- </a> | <a href='https://huggingface.co/spaces/camenduru-com/webui'> -- Stable Diffusion Webui (Camenduru Space) -- </a> | <a href='https://huggingface.co/spaces/ysharma/WizardCoder34b'> -- Wizard Coder 34B -- </a> | <a href='https://huggingface.co/spaces/chansung/co-write-with-llama2'> -- Cowrite with llama2 -- </a> | <a href='https://huggingface.co/spaces/fffiloni/Image-to-Story'> -- Image to Story -- </a> | <a href='https://huggingface.co/spaces/fffiloni/CLIP-Interrogator-2'> -- Clip interrogator 2 -- </a> | <a href='https://github.com/THUDM/AgentBench'> -- Agent Benchmarks -- </a> | <a href='https://www.convex.dev/ai-town'> -- AI Town Live Demo -- </a> = <a href='https://github.com/a16z-infra/ai-town'> -- AI Town Repository (Deployment]) -- </a> | <a href='https://github.com/joonspk-research/generative_agents/tree/main'> -- Generative Agents: Interactive Simulacra of Human Behavior (Research paper Repository) -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceM4/idefics_playground'> -- IDEFICS - open Multimodal model -- </a> | <a href='https://github.com/facebookresearch/belebele'> -- Belebele (Meta Dataset) -- </a> | <a href='https://huggingface.co/spaces/jbilcke-hf/ai-comic-factory'> -- AI Comic Factory -- </a> | <a href='https://github.com/camenduru'> -- CAMENDURU REPOS -- </a> | <a href='https://huggingface.co/datasets/b-mc2/sql-create-context'> -- SQL Dataset - A list of simple questions -- </a> | <a href='https://github.com/KillianLucas/open-interpreter'> -- Open Interpreter (alt to ChatGPT Pro) -- </a> | <a href='https://easywithai.com/fun-ai-tools/'> -- List - Easy with AI -- </a> | <a href='https://huggingface.co/spaces/Xenova/whisper-web'> -- Whisper Web (UI) -- </a> | <a href='https://blog.roblox.com/2023/09/revolutionizing-creation-roblox/'> -- Roblox Assistant -- </a> | <a href='https://huggingface.co/spaces/AP123/IllusionDiffusion'> -- Illusion Diffusion (Hide words or shapes in the image) -- </a> | <a href='https://huggingface.co/spaces/Shopify/background-replacement'> -- Background replacement - Shopify -- </a> | <a href='https://huggingface.co/spaces/multimodalart/LoraTheExplorer'> -- Lora The Explorer (SDXL) -- </a> | <a href='https://huggingface.co/spaces/XCLiu/InstaFlow'> -- InstaFlow (Under 1 second Inference) -- </a> | <a href='https://github.com/tairov/llama2.mojo'> -- TinyStories on mojo (230+ tk/s) -- </a> | <a href='https://emojis.alexandru.so/p/OHVEmfMwQl'> -- Any Emoji you want - emojijs -- </a> | <a href='https://huggingface.co/spaces/google/sdxl'> -- SDXL on TPUv5 -- </a> | """)
|
1383 |
+
gr.HTML("Placeholder for every images of each sentence - Good ChatGPT + Dall-E ")
|
1384 |
+
with gr.Row():
|
1385 |
+
with gr.Column(scale=4):
|
1386 |
+
imageplaceholderinput = gr.TextArea()
|
1387 |
+
with gr.Column(scale=1):
|
1388 |
+
gr.Label("Enter Text and Get a line by line placeholder for image associated with the text")
|
1389 |
+
imageplaceholderdownload = gr.File()
|
1390 |
+
imageplaceholderbtn = gr.Button("Create the image placeholder")
|
1391 |
+
with gr.Row():
|
1392 |
+
with gr.Column(scale=3):
|
1393 |
+
imageplaceholderoutput = gr.HTML("Preview will load here")
|
1394 |
+
with gr.Column(scale=2):
|
1395 |
+
imageplaceholdertextoutput = gr.Code("The code for the HTML created will come here")
|
1396 |
+
imageplaceholderbtn.click(fn=imagebasedreading, inputs=[imageplaceholderinput], outputs=[imageplaceholderdownload, imageplaceholderoutput, imageplaceholdertextoutput])
|
1397 |
with gr.Tab("Beginner - Listen + Read"):
|
1398 |
+
gr.Label("Closed Eye Recital per new word | 1 new word a minute while recycling the words from the previous minutes")
|
1399 |
with gr.Row():
|
1400 |
with gr.Column(scale=1):
|
1401 |
gr.HTML("Listening - Songs - Chorus <br> Anticipation of the item to remember is how you learn lyrics that is why songs are easy as if you heard it 10 times already your capacity to anticipate the words is great <br><br> This is where TTS helps as you are ignoring all words except the words just before the actual <br> <b>Tiny Stories dataset is like a graded reader</b> <br>")
|
1402 |
gr.Interface(fn=TTSforListeningPractice, inputs=["text", TTSLangOptions, "checkbox"], outputs="audio", description="Paste chorus lyrics from below here and use TTS or make notes to save here (Or paste anything)")
|
1403 |
+
with gr.Accordion("TTS Spaces", open=False):
|
1404 |
+
TTSspaceoptions = gr.Dropdown(choices=["https://huggingface.co/spaces/suno/bark"], label="existing whisper spaces")
|
1405 |
+
TTSspaceoptionsbtn = gr.Button("Load a Image as prompt Space")
|
1406 |
+
TTSspaceoptionsOut = gr.HTML()
|
1407 |
+
TTSspaceoptionsbtn.click(fn=display_website, inputs=TTSspaceoptions, outputs=TTSspaceoptionsOut)
|
1408 |
gr.HTML("<p>Fastest way to learn words = is to have your own sound reference --> probably why babies learn fast as they make random noise</p> <p>If you know the flow of the song you can remember the spelling easier</p><p>Essentially if the sounds are repeated or long notes they are easy to remember</p>")
|
1409 |
gr.Interface(fn=AutoChorusInvestigator, inputs="text", outputs="text", description="Paste Full Lyrics to try find only chorus lines")
|
1410 |
gr.Interface(fn=AutoChorusPerWordScheduler, inputs="text", outputs="text", description="Create order of repitition for tts practice")
|
|
|
1424 |
gr.Interface(fn=add_text_to_image , inputs=["image", "text"], outputs="image", description="Create Annotated images (Can create using stable diffusion and use the prompt) - Describe from one side to the other to make guessing easy")
|
1425 |
#with gr.Tab("Transcribe - RASMUS Whisper"):
|
1426 |
#gr.Interface.load("spaces/RASMUS/Whisper-youtube-crosslingual-subtitles", title="Subtitles")
|
1427 |
+
with gr.Tab("Beginner - Reading Assitant + Unknown Tracker"):
|
1428 |
+
gr.HTML(" <a href='https://www.onenote.com/learningtools'> -- Microsoft Immersive Reader (Comprehension) -- </a> | <a href='https://www.lingq.com/en/'> LingQ - (Word Familiarity based) </a> ")
|
1429 |
+
gr.HTML("Repitition of things you know is a waste of time when theres stuff you dont know <p> In Language the goal is bigger vocab --> Knowledge equivalent = question answer pairs but to get to those you need related information pairs</p> <p> Vocab = Glossary + all non text wall(lists, diagrams, etc.)</p>")
|
1430 |
+
gr.Textbox("Placeholder for a function that creates a set list and can takes a list for known words and auto find replaces the stuff you know out of the content")
|
1431 |
+
gr.Interface(fn=GuidedReading, inputs=["text", guidedreadingseperator], outputs="text", description="Manual POS Tag and Transliteration", examples=textspreprocess)
|
1432 |
+
gr.HTML("Place holder for a translate to english interface so that highlighting can still work as only english supported for now - <a href='https://translate.google.com/'> -- Google Translate -- </a>")
|
1433 |
+
gr.Interface(fn=UnknownTrackTexttoApp, inputs="text", outputs=["file", "html", "text"], description="HTML mini App - UNNWFWO (To track verbs you dont know for listening practice). Use the text from here to create lists you use for the TTS section")
|
1434 |
+
with gr.Tab("Unique word ID - use in Infranodus"):
|
1435 |
+
with gr.Accordion(label="Infranodus", open=False):
|
1436 |
+
gr.HTML(" <a href='https://infranodus.com/'> -- Infranodus - Word Level Knowledge graphs -- </a> | <br> Use the below interfaces to find the items that dont have entries --> These will represent new concepts or people which need to be understood individually to fully understand the text --> Infranodus search will help find related and unrelated investigation paths <br><br> TODO Figure Output Zoom / Image Dimensions")
|
1437 |
+
gr.Image(source="upload", label="Open Infranodus Screenshot")
|
1438 |
+
gr.Image(source="upload", label="Open Infranodus Screenshot")
|
1439 |
+
gr.Interface(fn=unique_word_count, inputs="text", outputs="text", description="Wordcounter")
|
1440 |
+
gr.HTML("Use the below interface to fill in the space in this format and then use the chat iframe at the top to ask llm to analyse this: <br><br> Consider how the following sentence meaning will change if the each if the selected word is replaced with one hypernym at a time: <br>Sentence: <br>Hypernyms: ")
|
1441 |
+
gr.Interface(fn=SepHypandSynExpansion, inputs="text", outputs=["text", "text"], description="Word suggestions - Analyse the unique words in infranodus")
|
1442 |
+
gr.Interface(fn=WikiSearch, inputs="text", outputs="text", description="One word at a time Unique word suggestions (wiki articles)")
|
1443 |
+
with gr.Tab("Automating related information linking"):
|
1444 |
+
gr.HTML("Questions - Taking and suggesting questions to ask = new education --> Esp. Infranodus type outer discourse identification as question generation")
|
1445 |
+
gr.HTML("The point of reading is to refine future actions especially problem solving --> Creating problem scenarios = thinking ahead of time = One form of effective reading")
|
1446 |
+
with gr.Tab("Beginner - Vague Language and Guessing POS"):
|
1447 |
+
with gr.Row():
|
1448 |
+
gr.HTML("Some Vague Words - Quantifiers, Pronouns, etc. <br/> <br/> Very, Many, Few, Lots, <br> Lets add 40 words to this list <br> <hr> Find Replace all nouns with something/someone or and for verbs figure out how to generalise them")
|
1449 |
+
gr.HTML("Parts of speech recognition = comprehension <br> Three word sentences will give a easier guessing chance")
|
1450 |
+
gr.HTML('<iframe src="https://spacy-gradio-pipeline-visualizer.hf.space" frameborder="0" width="100%" height="600"></iframe>')
|
1451 |
+
with gr.Tab("Advanced - Making Questions = Reading"):
|
1452 |
+
gr.HTML("Some Example Prompts <br><br>Please make 10 questions baseed on this text: <br>")
|
1453 |
+
with gr.Row():
|
1454 |
+
gr.TextArea("Paste the text to read here", interactive=True)
|
1455 |
+
gr.TextArea("Make as many questions on the text as you can in native language and then translate", interactive=True)
|
1456 |
+
gr.Dropdown(["Placeholder chunk 1", "Placeholder chunk 2", "Placeholder chunk 3"])
|
1457 |
+
gr.HTML("Load the current chunk here and Put a Dataframe where you have only one column for the questions")
|
1458 |
+
with gr.Tab('Acronym Map Creation Space'):
|
1459 |
+
gr.HTML("Acronym cant be read with previous attentive reading - accurate measure of known vs unknown")
|
1460 |
+
with gr.Row():
|
1461 |
+
with gr.Accordion('Acronym Map/Skeleton Creator'):
|
1462 |
+
gr.Interface(create_acronym_map, inputs='text', outputs=['text', 'text'])
|
1463 |
+
with gr.Accordion('Test with LLM'):
|
1464 |
+
gr.Label('Letters are always easier to recall than whole words. GPT 4 and above best suited for this prompt but can test anywhere')
|
1465 |
+
gr.HTML('Please help me study by making a acronym map for the maths ontology (Ask if theres questions)')
|
1466 |
+
gr.TextArea('', label='Paste LLM response')
|
1467 |
+
gr.HTML('Good but we need to now create a 9 Acronym based words - 1 for the headings together and then one each for the subheadings')
|
1468 |
+
gr.TextArea('', label='Paste LLM response')
|
1469 |
+
with gr.Accordion(''):
|
1470 |
+
gr.HTML('If study content was a map the first letters shape of the whole text = Roads')
|
1471 |
+
gr.HTML('Known = ability to match an item to a retrieval cue instantly - Retrieval cue for the whole text = Acronym Map')
|
1472 |
+
with gr.Tab("Advanced - Youtube - Subtitles - LingQ Addon Ideas"):
|
1473 |
gr.HTML("<a href='https://www.lingq.com/en/'>Find LingQ Here --> https://www.lingq.com/en/</a>")
|
1474 |
with gr.Tab("Visual - Multiline Custom Video Subtitles"):
|
1475 |
gr.HTML("LingQ Companion Idea - i.e. Full Translation Read along, and eventually Videoplayer watch along like RAMUS whisper space <br><br>Extra functions needed - Persitent Sentence translation, UNWFWO, POS tagging and Word Count per user of words in their account. Macaronic Text is also another way to practice only the important information")
|
|
|
1528 |
gr.Textbox("Merged Spelling Practice Placeholder - Spell multiple words simultaneously for simultaneous access", lines=3)
|
1529 |
gr.HTML("<p> Spell multiple words simultaneously for simultaneous access </p> <p> Spelling Simplification - Use a dual language list? | Spelling is the end goal, you already know many letter orders called words so you need leverage them to remember random sequences")
|
1530 |
gr.Interface(fn=create_dictionary, inputs="text", outputs="text", title="Sort Text by first two letters")
|
1531 |
+
gr.Interface(fn=keep_nouns_verbs, inputs=["text"], outputs="text", description="Noun and Verbs only (Plus punctuation)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1532 |
with gr.Tab("Thinking Practice (POS)"):
|
1533 |
gr.HTML("By removing all nouns and verbs you get a format to practice thinking about your words to use to make sentences which make sense within constraints")
|
1534 |
+
with gr.Row():
|
1535 |
+
with gr.Column():
|
1536 |
+
with gr.Tab("Sentence to Practice Format"):
|
1537 |
+
gr.Interface(fn=split_verbs_nouns , inputs="text", outputs=["text", "text", "text"], description="Comprehension reading and Sentence Format Creator")
|
1538 |
+
with gr.Column():
|
1539 |
+
gr.HTML("<a href='https://huggingface.co/datasets/b-mc2/sql-create-context'> -- SQL Dataset - A list of simple questions -- </a> |")
|
1540 |
+
gr.Textbox(label='Use this text to hold translations of the SQL rows in the above linked dataset (A kind of What I say vs what I want)')
|
1541 |
with gr.Tab("Knowledge Ideas - Notetaking"):
|
1542 |
gr.HTML("""<p>Good knowledge = ability to answer questions --> find Questions you cant answer and look for hidden answer within them </p>
|
1543 |
<p>My One Word Theory = We only use more words than needed when we have to or are bored --> Headings exist because title is not sufficient, subheadings exist because headings are not sufficient, Book Text exists because subheadings are not sufficient</p>
|
1544 |
<p>Big Picture = Expand the Heading and the subheadings and compare them to each other</p>
|
1545 |
<p>Application of Knowledge = App Version of the text (eg. Jupyter Notebooks) is what you create and learn first</p>
|
1546 |
""")
|
1547 |
+
gr.Label('Placeholder for LLM api plus the drop down function below populate text for each line into dropdowns')
|
1548 |
gr.Interface(fn=TextCompFormat, inputs=["textarea", HTMLCompMode], outputs="text", description="Convert Text to HTML Dropdown or Links which you paste in any html file")
|
1549 |
gr.Interface(fn=create_collapsiblebutton, inputs=["textbox", "textbox", "textarea"], outputs="textbox", description="Button and Div HTML Generator, Generate the HTML for a button and the corresponding div element.")
|
1550 |
+
with gr.Tab("Real-Time AI - Video/Audio/AR"):
|
1551 |
+
gr.HTML("HUD Experiment (Waiting for GPT4V API)- Full context of user situation + Ability to communicate in real-time to user using images (H100+ and low enough resolution and low enough steps - it/s = fps) - just like google maps but for real life")
|
1552 |
+
gr.Interface(fn=ImageTranslationTest , inputs=[VideoTestInput, VideoTestSubtitleInput], outputs="video")
|
1553 |
+
with gr.Accordion("Whisper Spaces"):
|
1554 |
+
Whisperspaceoptions = gr.Dropdown(choices=["https://sanchit-gandhi-whisper-jax-diarization.hf.space", "https://sanchit-gandhi-whisper-jax.hf.space", "https://sanchit-gandhi-whisper-large-v2.hf.space", "https://facebook-seamless-m4t.hf.space"], label="existing whisper spaces")
|
1555 |
+
Whisperspaceoptionsbtn = gr.Button("Load Whisper Space")
|
1556 |
+
WhisperspaceoptionsOut = gr.HTML()
|
1557 |
+
Whisperspaceoptionsbtn.click(fn=display_website, inputs=Whisperspaceoptions, outputs=WhisperspaceoptionsOut)
|
1558 |
+
with gr.Accordion("Image as prompt Spaces"):
|
1559 |
+
Imagepromptspaceoptions = gr.Dropdown(choices=["https://badayvedat-llava.hf.space", "https://xinyu1205-recognize-anything.hf.space"], label="existing whisper spaces")
|
1560 |
+
Imagepromptspaceoptionsbtn = gr.Button("Load a Image as prompt Space")
|
1561 |
+
ImagepromptspaceoptionsOut = gr.HTML()
|
1562 |
+
Imagepromptspaceoptionsbtn.click(fn=display_website, inputs=Imagepromptspaceoptions, outputs=ImagepromptspaceoptionsOut)
|
1563 |
+
with gr.Accordion("Old Ideas to consider", open=False):
|
1564 |
+
gr.HTML("Nicolai Nielsen Youtube channel - aruco markers = position --> can test using premade ones from an image search")
|
1565 |
+
gr.Textbox("Alpha Test version = Real time Lablling of All things in view using SAM and Clip Interrogator and OpenCV on pydroid --> Adjusted Demo")
|
1566 |
+
gr.HTML("Some Prompt ideas --> Prompt: Describe the place where these descriptions may be (You job is to be speculative for brainstorming purposes): A dog and a boy, the area is texas, the weather is sunny, the date is 01 May 2021 <hr> Prompt Content Ideas Ideas Clip Interrogator + Location Data aka tags for place, location and time + general news updates on the location + overview of the items in the location <br> Location based advise is most important but after that is information observed by appliances in the location eg. Times Computer turned on, times geyser inspected, amount of time keys havent been touched etc. <br> each location will have an ai personality that will relay more information ")
|
1567 |
+
gr.HTML("<a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a>")
|
1568 |
+
with gr.Tab("Incomplete Tests and Experiments"):
|
1569 |
+
with gr.Tab("Graph Based Reading", id="1"):
|
1570 |
+
gr.Textbox('Parts of Speech based | Automating the Notetaking Tab either directly or using visual llm to use this interface efficiently')
|
1571 |
+
gr.HTML("Types of comprehension agent <hr> Speed of Comprehension = Verb comprehension <br> From the following please extract the verbs <br> now explain each in context <br> Next, use picture descriptions for each word in the verb list <br> Create combinations using the verb list <hr> ")
|
1572 |
+
gr.HTML("How VERBS RELATE TO EACH OTHER --> Shared Nodes - what other verbs are connected to the noun in a INFRANODUS With POS Tag filters")
|
1573 |
+
gr.HTML("Tree and Branches approach to learning = familiarity with keywords/headings/summaries before reading the whole text <hr> Productivity/Work revolves around repitition which can be found looking for plurals and grouping terms eg. Headings and Hyper/Hyponyms Analysis")
|
1574 |
+
gr.HTML("Sentence to PyDot graph")
|
1575 |
+
gr.HTML("Currently a bug that locks all buttons in the space when you use this above example - Reload to fix")
|
1576 |
+
with gr.Tab("Random Ideas"):
|
1577 |
+
gr.HTML("""<p>Spaces Test - Still Undercontruction --> Next Milestone is Turning this interface handsfree | Knowledge is a Language but productive knowledge is find replace as well | LingQ is good option for per word state management</p> <p> Arrows app json creator for easy knowledge graphing and spacy POS graph? --> Questions? -->
|
1578 |
+
<p> ChatGPT Turns Learning into a read only what you dont know ask only what you dont know feedback loop --> All you have to do is keep track of what prompts you have asked in the past</p> """)
|
1579 |
+
gr.HTML("<p>Target 0: Mnemonics as title of images --> Comprehensible input <br> Target 1: Dual audio at word Level while using repitition to train random recall --> Word level Time <br> Target 2: Video --> Split by sentence --> each word repeated (60) + each phrase (10) + each sentence (10) --> TTS file for practice --> State Management/Known word Tracker <br>-----------------------<br> The trick is minimum one minute of focus on a new word --> Listening is hard because there are new word within seconds and you need repeated focus on each to learn </p> <p>Audio = best long form attention mechanism AS it is ANTICIPATION (Awareness of something before it happens like knowing song Lyrics) FOCUSED - Attention (Focused Repitition) + Exposure (Random Repitition) </p> <p>Listening is hard due to different word order and word combinations (collocations more important than single words)</p> <hr>")
|
1580 |
+
gr.HTML("Predictable to identify the parts of picture being described --> The description moves in one direction from one side of the image to the other side is easiest <hr>")
|
1581 |
+
gr.HTML("Image = instant comprehension like Stable Diffusion --> Audiovisual experience is the most optimal reading experience <br> Manga with summary descriptions for the chapters = Most aligned visual to audio experience")
|
1582 |
+
with gr.Tab("AI Tools, Prompts and games"):
|
1583 |
+
gr.HTML("TODO = Llama-cpp-python with falcon 7b / openllama 7b intergrated into each of the interfaces in this space aka --> interfaces as tools for open source llm <br><br> <b>Test using gradio space/interfaces through the api as function calls for gpt3.5 and 4</b>")
|
1584 |
+
with gr.Accordion('Command Based Tools - Instant verification of ability to describe'):
|
1585 |
+
gr.HTML("Roblox - <a href='https://blog.roblox.com/2023/09/revolutionizing-creation-roblox/'> -- Roblox Assistant -- </a> | <br> ")
|
1586 |
+
#with gr.Tab("Gradio Client Tests"):
|
1587 |
+
# gr.HTML("How to return componets here in gradio (as each client interface needs different inputs) like in react")
|
1588 |
+
with gr.Tab("Current Ideas to edit old sections"):
|
1589 |
+
gr.HTML("The core themes = scheduling (randomisation and calendar marking), speed practice, visualisation, and audio, repitition, compression and finally Tracking and only learning the unknown")
|
1590 |
+
gr.HTML("Parts that are already done - Repition and scheduling (randomisation) on the sidebar, compresion using the acronym tab, Audio in the beginning tab, unknown partially in HTML creator")
|
1591 |
+
gr.HTML("Parts that are not done - Visualisation (of acronyms / duo word sets / nouns and verbs) - The image placeholder creator script, Tracking (private = database, public = textfile export), calendar based scheduling aka alert based ")
|
1592 |
+
gr.HTML("React Version of the app can combine all of these use cases into one component - so far tracking, placeholder and partially scheduling have been done")
|
1593 |
+
gr.Label('True speed simultaneous - which is a boolean state = practice at simulataneous to get simultaneous |||| Another way to be fast is to practice simultaneously with the varios SOVs i.e. when you read a noun the verb must appear immediately and vice versa |||| Simultaneous Spelling is the other way to practice |||| The main goal of all reading is that next time you read you take less time this time: |||| Spped = ability to anticipate the next word |||| Anticipation of a sentence = POV |||| ')
|
1594 |
+
with gr.Tab("Text to image for only nouns "):
|
1595 |
+
gr.Label("Placeholder for the transformers code Generator that can be used by anyone with gpu to turn all nouns in their text to pictures (The lambda labs code)")
|
1596 |
+
with gr.Tab("Simultanoues Practice Zone"):
|
1597 |
+
gr.Label("Audio based space where you must look at the corresponding text for the audio thats playing as simultaneous practice")
|
1598 |
+
gr.DataFrame(None, headers=["text", "audio"], label="Add text pairs to practice", interactive=True)
|
1599 |
+
gr.HTML("Below you can create and listen to the audio")
|
1600 |
+
gr.Interface(fn=SimultaneousSpellingPrac, inputs=["text"], outputs=["text"], title="Simultaneous SpellingOrder fast fast practice --> 1 letter a word = fastest read")
|
1601 |
+
gr.Interface(fn=FirstLetterSummary, inputs=["text"], outputs=["text"], title="Order fast fast practice --> 1 letter a word = fastest read")
|
1602 |
+
gr.Interface(fn=imagebasedreading, inputs=["text"], outputs=["file", "html", "text"], title="Placeholder for every newline")
|
1603 |
+
with gr.Tab("Long Text Analysis"):
|
1604 |
+
gr.Interface(fn=LoadNLTKUDHRText, inputs=NLTKudhr, outputs=["text", "textarea"])
|
1605 |
+
gr.HTML("For Long text searches are useful under time pressure and also bring all direct interactions with search terms - a word is defined by those around it")
|
1606 |
+
gr.Interface(fn=onlyplurals, inputs=["text"], outputs=["text"], title="Only plurals = optimal concepts to learn first as work = repitition")
|
1607 |
+
gr.Label("Placeholder for old code for concordance and word counting in other test space")
|
1608 |
+
with gr.Tab("Video Segmentation with OpenCV Test"):
|
1609 |
+
gr.Interface(fn=segment_video_with_opencv, inputs=VideoSplitTestInput, outputs="fileexplorer")
|
1610 |
+
|
1611 |
|
|
|
1612 |
lliface.queue().launch() #(inbrowser="true")
|