BioMike BioMikeUkr commited on
Commit
b03b2db
1 Parent(s): 6edbad7

Model replaced with knowledgator/gliner-multitask-v1.0 and ner task (Text Classification added)

Browse files
app.py CHANGED
@@ -4,10 +4,10 @@ subprocess.run(["pip", "install", "utca>=0.1.0"])
4
  subprocess.run(["pip", "install", "gradio==4.31.5"])
5
 
6
  import gradio as gr
7
- from interfaces import ner_interface, qa_interface, open_ie_interface, summarization_interface, landing_interface, relation_e_interface, universal_interface
8
 
9
- demo = gr.TabbedInterface([landing_interface, ner_interface, qa_interface, open_ie_interface, summarization_interface, relation_e_interface, universal_interface],
10
- ["Introduction", "NER", "Question Answering", "Open Information Extracting", "Summarization", "Relation Extracting", "Universal Task"],
11
  title="GLiNER HandyLab",
12
  theme=gr.themes.Base())
13
 
 
4
  subprocess.run(["pip", "install", "gradio==4.31.5"])
5
 
6
  import gradio as gr
7
+ from interfaces import ner_interface, qa_interface, open_ie_interface, summarization_interface, landing_interface, relation_e_interface, universal_interface, classification_interface
8
 
9
+ demo = gr.TabbedInterface([landing_interface, ner_interface, qa_interface, open_ie_interface, summarization_interface, relation_e_interface, classification_interface, universal_interface],
10
+ ["Introduction", "NER", "Question Answering", "Open Information Extracting", "Summarization", "Relation Extracting", "Text Classification", "Universal Task"],
11
  title="GLiNER HandyLab",
12
  theme=gr.themes.Base())
13
 
gradio_cached_examples/16/log.csv DELETED
@@ -1,4 +0,0 @@
1
- Predicted Entities,flag,username,timestamp
2
- "[{""token"": ""\nDr. "", ""class_or_confidence"": null}, {""token"": ""Paul Hammond"", ""class_or_confidence"": ""neurologist""}, {""token"": "", a renowned neurologist at "", ""class_or_confidence"": null}, {""token"": ""Johns Hopkins University"", ""class_or_confidence"": ""university""}, {""token"": "", has recently published a paper in the prestigious journal \"""", ""class_or_confidence"": null}, {""token"": ""Nature Neuroscience"", ""class_or_confidence"": ""journal""}, {""token"": ""\"". His research focuses on a rare "", ""class_or_confidence"": null}, {""token"": ""genetic mutation"", ""class_or_confidence"": ""biological process""}, {""token"": "", found in less than 0.01% of the population, that appears to prevent the development of "", ""class_or_confidence"": null}, {""token"": ""Alzheimer's disease"", ""class_or_confidence"": ""disease""}, {""token"": "". Collaborating with researchers at the "", ""class_or_confidence"": null}, {""token"": ""University of California"", ""class_or_confidence"": ""university""}, {""token"": "", "", ""class_or_confidence"": null}, {""token"": ""San Francisco"", ""class_or_confidence"": ""city""}, {""token"": "", the team is now working to understand the mechanism by which this mutation confers its protective effect. Funded by the "", ""class_or_confidence"": null}, {""token"": ""National Institutes of Health"", ""class_or_confidence"": ""university""}, {""token"": "", their research could potentially open new avenues for Alzheimer's treatment.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:19:47.389544
3
- "[{""token"": ""\n\""I recently purchased the "", ""class_or_confidence"": null}, {""token"": ""Sony WH-1000XM4 Wireless Noise-Canceling Headphones"", ""class_or_confidence"": ""product""}, {""token"": "" from "", ""class_or_confidence"": null}, {""token"": ""Amazon"", ""class_or_confidence"": ""brand""}, {""token"": "" and I must say, I'm thoroughly impressed. The package arrived in "", ""class_or_confidence"": null}, {""token"": ""New York"", ""class_or_confidence"": ""location""}, {""token"": "" within 2 days, thanks to "", ""class_or_confidence"": null}, {""token"": ""Amazon"", ""class_or_confidence"": ""brand""}, {""token"": "" Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The "", ""class_or_confidence"": null}, {""token"": ""noise-canceling feature"", ""class_or_confidence"": ""features""}, {""token"": "" works like a charm in the bustling city environment, and the "", ""class_or_confidence"": null}, {""token"": ""30-hour battery life"", ""class_or_confidence"": ""features""}, {""token"": "" means I don't have to charge them every day. Connecting them to my "", ""class_or_confidence"": null}, {""token"": ""Samsung Galaxy S21"", ""class_or_confidence"": ""product""}, {""token"": "" was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from "", ""class_or_confidence"": null}, {""token"": ""Amazon"", ""class_or_confidence"": ""brand""}, {""token"": "" when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, the "", ""class_or_confidence"": null}, {""token"": ""headphones"", ""class_or_confidence"": ""product""}, {""token"": "" did not come with a hard case, which was listed in the product description. I contacted "", ""class_or_confidence"": null}, {""token"": ""Amazon"", ""class_or_confidence"": ""brand""}, {""token"": "", and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a "", ""class_or_confidence"": null}, {""token"": ""4.5/5"", ""class_or_confidence"": ""rating""}, {""token"": "" rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 21:19:49.044543
4
- "[{""token"": ""\nSeveral studies have reported its pharmacological activities, including anti-inflammatory, antimicrobial, and antitumoral effects.\nThe effect of E-anethole was studied in the osteosarcoma "", ""class_or_confidence"": null}, {""token"": ""MG-63 cell line"", ""class_or_confidence"": ""cell line""}, {""token"": "", and the antiproliferative activity was evaluated by an MTT assay.\nIt showed a "", ""class_or_confidence"": null}, {""token"": ""GI50"", ""class_or_confidence"": ""metric""}, {""token"": "" value of 60.25 \u03bcM with apoptosis induction through the mitochondrial-mediated pathway. Additionally, it induced cell cycle arrest at the G0/G1 phase, up-regulated the expression of p53, caspase-3, and caspase-9, and down-regulated Bcl-xL expression.\nMoreover, the antitumoral activity of anethole was assessed against oral tumor "", ""class_or_confidence"": null}, {""token"": ""Ca9-22 cells"", ""class_or_confidence"": ""cell line""}, {""token"": "", and the cytotoxic effects were evaluated by MTT and LDH assays.\nIt demonstrated a "", ""class_or_confidence"": null}, {""token"": ""LD50"", ""class_or_confidence"": ""metric""}, {""token"": "" value of 8 \u03bcM, and cellular proliferation was 42.7% and 5.2% at anethole "", ""class_or_confidence"": null}, {""token"": ""concentrations"", ""class_or_confidence"": ""metric""}, {""token"": "" of 3 \u03bcM and 30 \u03bcM, respectively.\nIt was reported that it could selectively and in a dose-dependent manner decrease cell proliferation and induce apoptosis, as well as induce autophagy, decrease ROS production, and increase glutathione activity. The cytotoxic effect was mediated through NF-kB, MAP kinases, Wnt, caspase-3 and -9, and PARP1 pathways. Additionally, treatment with anethole inhibited cyclin D1 oncogene expression, increased cyclin-dependent kinase inhibitor "", ""class_or_confidence"": null}, {""token"": ""p21WAF1"", ""class_or_confidence"": ""protein""}, {""token"": "", up-regulated p53 expression, and inhibited the EMT markers.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:19:51.221542
 
 
 
 
 
gradio_cached_examples/25/log.csv DELETED
@@ -1,4 +0,0 @@
1
- Predicted Entities,flag,username,timestamp
2
- "[{""token"": ""Extract all positive aspects of the product:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. "", ""class_or_confidence"": null}, {""token"": ""The package arrived in New York within 2 days"", ""class_or_confidence"": ""match""}, {""token"": "", thanks to Amazon Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The "", ""class_or_confidence"": null}, {""token"": ""noise-canceling feature works like a charm in the bustling city environment"", ""class_or_confidence"": ""match""}, {""token"": "", and the "", ""class_or_confidence"": null}, {""token"": ""30-hour battery life"", ""class_or_confidence"": ""match""}, {""token"": "" means I don't have to charge them every day. "", ""class_or_confidence"": null}, {""token"": ""Connecting them to my Samsung Galaxy S21 was a breeze"", ""class_or_confidence"": ""match""}, {""token"": "", and the "", ""class_or_confidence"": null}, {""token"": ""sound quality is second to none"", ""class_or_confidence"": ""match""}, {""token"": "".\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 21:19:59.970805
3
- "[{""token"": ""Extract all negative aspects of the product:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, "", ""class_or_confidence"": null}, {""token"": ""the headphones did not come with a hard case"", ""class_or_confidence"": ""match""}, {""token"": "", which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 21:20:01.535806
4
- "[{""token"": ""Find the name of the computer for which the first Microsoft product was developed:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March\u00a02023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975 to develop and sell BASIC interpreters for the "", ""class_or_confidence"": null}, {""token"": ""Altair 8800"", ""class_or_confidence"": ""match""}, {""token"": "". During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by Steve Wozniak, Steve Jobs (1955\u20132011) and Ronald Wayne to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:20:04.006805
 
 
 
 
 
gradio_cached_examples/35/log.csv DELETED
@@ -1,3 +0,0 @@
1
- Summary,Predicted Entities,flag,username,timestamp
2
- "The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.","[{""token"": ""Summarize the given text, highlighting the most important information:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. "", ""class_or_confidence"": null}, {""token"": ""The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping."", ""class_or_confidence"": ""summary""}, {""token"": ""\n\nThe headphones themselves are remarkable. "", ""class_or_confidence"": null}, {""token"": ""The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day."", ""class_or_confidence"": ""summary""}, {""token"": "" Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\n"", ""class_or_confidence"": null}, {""token"": ""Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": ""summary""}, {""token"": """", ""class_or_confidence"": null}]",,,2024-05-31 21:20:12.667603
3
- "Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world.","[{""token"": ""Summarize the given text, highlighting the most important information:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. "", ""class_or_confidence"": null}, {""token"": ""Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue."", ""class_or_confidence"": ""summary""}, {""token"": "" As of March\u00a02023, Apple is the world's biggest company by market capitalization. "", ""class_or_confidence"": null}, {""token"": ""As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world."", ""class_or_confidence"": ""summary""}, {""token"": "" It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975 to develop and sell BASIC interpreters for the Altair 8800. During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by Steve Wozniak, Steve Jobs (1955\u20132011) and Ronald Wayne to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:20:15.170601
 
 
 
 
gradio_cached_examples/45/log.csv DELETED
@@ -1,2 +0,0 @@
1
- Predicted Relation,flag,username,timestamp
2
- "[{'source': {'start': 5, 'end': 17, 'span': 'Paul Hammond', 'score': 0.9541130065917969, 'entity': 'scientist'}, 'relation': 'worked at', 'target': {'start': 45, 'end': 69, 'span': 'Johns Hopkins University', 'score': 0.9601001143455505, 'entity': 'university'}, 'score': 0.8696132302284241}]",,,2024-05-31 21:20:27.796814
 
 
 
gradio_cached_examples/56/log.csv DELETED
@@ -1,4 +0,0 @@
1
- Predicted Entities,flag,username,timestamp
2
- "[{""token"": ""Extract all positive aspects of the product:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 21:20:41.275340
3
- "[{""token"": ""Extract all negative aspects of the product:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, "", ""class_or_confidence"": null}, {""token"": ""the headphones did not come with a hard case"", ""class_or_confidence"": ""match""}, {""token"": "", which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 21:20:42.941340
4
- "[{""token"": ""Find the name of the computer for which the first Microsoft product was developed:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March\u00a02023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975 to develop and sell BASIC interpreters for the "", ""class_or_confidence"": null}, {""token"": ""Altair 8800"", ""class_or_confidence"": ""match""}, {""token"": "". During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by Steve Wozniak, Steve Jobs (1955\u20132011) and Ronald Wayne to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:20:45.506342
 
 
 
 
 
gradio_cached_examples/60/log.csv DELETED
@@ -1,4 +0,0 @@
1
- Predicted Entities,flag,username,timestamp
2
- "[{""token"": ""Extract all positive aspects of the product:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 23:27:58.157081
3
- "[{""token"": ""Extract all negative aspects of the product:\n\n\""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.\n\nThe headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, "", ""class_or_confidence"": null}, {""token"": ""the headphones did not come with a hard case"", ""class_or_confidence"": ""match""}, {""token"": "", which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\nOverall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": null}]",,,2024-05-31 23:27:59.833082
4
- "[{""token"": ""Find the name of the computer for which the first Microsoft product was developed:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March\u00a02023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975 to develop and sell BASIC interpreters for the "", ""class_or_confidence"": null}, {""token"": ""Altair 8800"", ""class_or_confidence"": ""match""}, {""token"": "". During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by Steve Wozniak, Steve Jobs (1955\u20132011) and Ronald Wayne to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 23:28:02.396082
 
 
 
 
 
gradio_cached_examples/7/log.csv DELETED
@@ -1,3 +0,0 @@
1
- Predicted Entities,flag,username,timestamp
2
- "[{""token"": ""Who are the founders of Microsoft:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March\u00a02023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by "", ""class_or_confidence"": null}, {""token"": ""Bill Gates"", ""class_or_confidence"": ""answer""}, {""token"": "" and "", ""class_or_confidence"": null}, {""token"": ""Paul Allen"", ""class_or_confidence"": ""answer""}, {""token"": "" on April 4, 1975 to develop and sell BASIC interpreters for the Altair 8800. During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by Steve Wozniak, Steve Jobs (1955\u20132011) and Ronald Wayne to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:19:36.728538
3
- "[{""token"": ""Who are the founders of Apple?:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March\u00a02023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975 to develop and sell BASIC interpreters for the Altair 8800. During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by "", ""class_or_confidence"": null}, {""token"": ""Steve Wozniak"", ""class_or_confidence"": ""answer""}, {""token"": "", "", ""class_or_confidence"": null}, {""token"": ""Steve Jobs"", ""class_or_confidence"": ""answer""}, {""token"": "" (1955\u20132011) and "", ""class_or_confidence"": null}, {""token"": ""Ronald Wayne"", ""class_or_confidence"": ""answer""}, {""token"": "" to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 21:19:39.407538
 
 
 
 
interfaces/__init__.py CHANGED
@@ -4,4 +4,5 @@ from .open_ie import open_ie_interface
4
  from .summarization import summarization_interface
5
  from .relation_e import relation_e_interface
6
  from .landing import landing_interface
7
- from .universal import universal_interface
 
 
4
  from .summarization import summarization_interface
5
  from .relation_e import relation_e_interface
6
  from .landing import landing_interface
7
+ from .universal import universal_interface
8
+ from .classification import classification_interface
interfaces/__pycache__/__init__.cpython-310.pyc DELETED
Binary file (478 Bytes)
 
interfaces/__pycache__/landing.cpython-310.pyc DELETED
Binary file (1.33 kB)
 
interfaces/__pycache__/ner.cpython-310.pyc DELETED
Binary file (5.74 kB)
 
interfaces/__pycache__/open_ie.cpython-310.pyc DELETED
Binary file (5.44 kB)
 
interfaces/__pycache__/qa.cpython-310.pyc DELETED
Binary file (4.27 kB)
 
interfaces/__pycache__/relation_e.cpython-310.pyc DELETED
Binary file (3.75 kB)
 
interfaces/__pycache__/summ.cpython-310.pyc DELETED
Binary file (5.52 kB)
 
interfaces/__pycache__/universal.cpython-310.pyc DELETED
Binary file (5.7 kB)
 
interfaces/classification.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from gliner import GLiNER
2
+ import gradio as gr
3
+
4
+ model = GLiNER.from_pretrained("knowledgator/gliner-multitask-v1.0").to("cpu")
5
+
6
+ PROMPT_TEMPLATE = """Classify the given text having the following classes: {}"""
7
+ classification_examples = [
8
+ [
9
+ "The sun is shining and the weather is warm today.",
10
+ "Weather, Food, Technology",
11
+ 0.5
12
+ ],
13
+ [
14
+ "I really enjoyed the pizza we had for dinner last night.",
15
+ "Food, Weather, Sports",
16
+ 0.5
17
+ ],
18
+ [
19
+ "Das Kind spielt im Park und genießt die frische Luft.",
20
+ "Nature, Technology, Politics",
21
+ 0.5
22
+ ]
23
+ ]
24
+
25
+ def prepare_prompts(text, labels):
26
+ labels_str = ', '.join(labels)
27
+ return PROMPT_TEMPLATE.format(labels_str) + "\n" + text
28
+
29
+ def process(text, labels, threshold):
30
+ if not text.strip() or not labels.strip():
31
+ return {"text": text, "entities": []}
32
+
33
+ labels = [label.strip() for label in labels.split(",")]
34
+ prompt = prepare_prompts(text, labels)
35
+
36
+ predictions = model.run([prompt], ["match"], threshold=threshold)
37
+ entities = []
38
+
39
+ if predictions and predictions[0]:
40
+ for pred in predictions[0]:
41
+ entities.append({
42
+ "entity": "match",
43
+ "word": pred["text"],
44
+ "start": pred["start"],
45
+ "end": pred["end"],
46
+ "score": pred["score"]
47
+ })
48
+
49
+ return {"text": prompt, "entities": entities}
50
+
51
+ with gr.Blocks(title="Text Classification with Highlighted Labels") as classification_interface:
52
+ gr.Markdown("# Text Classification with Highlighted Labels")
53
+
54
+ input_text = gr.Textbox(label="Input Text", placeholder="Enter text for classification")
55
+ input_labels = gr.Textbox(label="Labels (Comma-Separated)", placeholder="Enter labels separated by commas (e.g., Positive, Negative, Neutral)")
56
+ threshold = gr.Slider(0, 1, value=0.5, step=0.01, label="Threshold")
57
+
58
+ output = gr.HighlightedText(label="Classification Results")
59
+
60
+ submit_btn = gr.Button("Classify")
61
+
62
+ examples = gr.Examples(
63
+ examples=classification_examples,
64
+ inputs=[input_text, input_labels, threshold],
65
+ outputs=output,
66
+ fn=process,
67
+ cache_examples=True
68
+ )
69
+ theme=gr.themes.Base()
70
+
71
+
72
+ input_text.submit(fn=process, inputs=[input_text, input_labels, threshold], outputs=outpu)
73
+ threshold.release(fn=process, inputs=[input_text, input_labels, threshold], outputs=outpu)
74
+ submit_btn.click(fn=process, inputs=[input_text, input_labels, threshold], outputs=output)
75
+
76
+ if __name__ == "__main__":
77
+ classification_interface.launch()
interfaces/gradio_cached_examples/8/log.csv DELETED
@@ -1,3 +0,0 @@
1
- Summary,Predicted Entities,flag,username,timestamp
2
- "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.","[{""token"": ""Summarize the given text, highlighting the most important information:\n\n\"""", ""class_or_confidence"": null}, {""token"": ""I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping."", ""class_or_confidence"": ""summary""}, {""token"": ""\n\nThe headphones themselves are remarkable. "", ""class_or_confidence"": null}, {""token"": ""The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day."", ""class_or_confidence"": ""summary""}, {""token"": "" Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.\n\nI also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.\n\nHowever, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.\n\n"", ""class_or_confidence"": null}, {""token"": ""Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service."", ""class_or_confidence"": ""summary""}, {""token"": """", ""class_or_confidence"": null}]",,,2024-05-31 20:59:50.572164
3
- "Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world.","[{""token"": ""Summarize the given text, highlighting the most important information:\n\nApple Inc. is an American multinational technology company headquartered in Cupertino, California. "", ""class_or_confidence"": null}, {""token"": ""Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue."", ""class_or_confidence"": ""summary""}, {""token"": "" As of March\u00a02023, Apple is the world's biggest company by market capitalization. "", ""class_or_confidence"": null}, {""token"": ""As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world."", ""class_or_confidence"": ""summary""}, {""token"": "" It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975 to develop and sell BASIC interpreters for the Altair 8800. During his career at Microsoft, Gates held the positions of chairman, chief executive officer, president and chief software architect, while also being the largest individual shareholder until May 2014.\nApple was founded as Apple Computer Company on April 1, 1976, by Steve Wozniak, Steve Jobs (1955\u20132011) and Ronald Wayne to develop and sell Wozniak's Apple I personal computer. It was incorporated by Jobs and Wozniak as Apple Computer, Inc. in 1977. The company's second computer, the Apple II, became a best seller and one of the first mass-produced microcomputers. Apple went public in 1980 to instant financial success. The company developed computers featuring innovative graphical user interfaces, including the 1984 original Macintosh, announced that year in a critically acclaimed advertisement called \""1984\"". By 1985, the high cost of its products, and power struggles between executives, caused problems. Wozniak stepped back from Apple and pursued other ventures, while Jobs resigned and founded NeXT, taking some Apple employees with him.\n"", ""class_or_confidence"": null}]",,,2024-05-31 20:59:53.095162
 
 
 
 
interfaces/ner.py CHANGED
@@ -2,7 +2,7 @@ from typing import Dict, Union
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
- model = GLiNER.from_pretrained("knowledgator/gliner-multitask-large-v0.5").to('cpu')
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
 
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
+ model = GLiNER.from_pretrained("knowledgator/gliner-multitask-v1.0").to("cpu")
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
interfaces/open_ie.py CHANGED
@@ -2,7 +2,7 @@ from typing import Dict, Union
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
- model = GLiNER.from_pretrained("knowledgator/gliner-multitask-large-v0.5").to('cpu')
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
 
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
+ model = GLiNER.from_pretrained("knowledgator/gliner-multitask-v1.0").to("cpu")
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
interfaces/qa.py CHANGED
@@ -2,7 +2,7 @@ from typing import Dict, Union
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
- model = GLiNER.from_pretrained("knowledgator/gliner-multitask-large-v0.5").to('cpu')
6
 
7
  text2 = """
8
  Apple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March 2023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.
 
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
+ model = GLiNER.from_pretrained("knowledgator/gliner-multitask-v1.0").to("cpu")
6
 
7
  text2 = """
8
  Apple Inc. is an American multinational technology company headquartered in Cupertino, California. Apple is the world's largest technology company by revenue, with US$394.3 billion in 2022 revenue. As of March 2023, Apple is the world's biggest company by market capitalization. As of June 2022, Apple is the fourth-largest personal computer vendor by unit sales and the second-largest mobile phone manufacturer in the world. It is considered one of the Big Five American information technology companies, alongside Alphabet (parent company of Google), Amazon, Meta Platforms, and Microsoft.
interfaces/relation_e.py CHANGED
@@ -21,7 +21,7 @@ Dr. Paul Hammond, a renowned neurologist at Johns Hopkins University, has recent
21
 
22
  predictor = GLiNERPredictor( # Predictor manages the model that will be used by tasks
23
  GLiNERPredictorConfig(
24
- model_name = "knowledgator/gliner-multitask-large-v0.5", # Model to use
25
  device = "cpu", # Device to use
26
  )
27
  )
 
21
 
22
  predictor = GLiNERPredictor( # Predictor manages the model that will be used by tasks
23
  GLiNERPredictorConfig(
24
+ model_name = "knowledgator/gliner-multitask-v1.0", # Model to use
25
  device = "cpu", # Device to use
26
  )
27
  )
interfaces/summarization.py CHANGED
@@ -2,7 +2,7 @@ from typing import Dict, Union
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
- model = GLiNER.from_pretrained("knowledgator/gliner-multitask-large-v0.5").to('cpu')
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
 
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
+ model = GLiNER.from_pretrained("knowledgator/gliner-multitask-v1.0").to('cpu')
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
interfaces/universal.py CHANGED
@@ -2,7 +2,7 @@ from typing import Dict, Union
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
- model = GLiNER.from_pretrained("knowledgator/gliner-multitask-large-v0.5").to('cpu')
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
 
2
  from gliner import GLiNER
3
  import gradio as gr
4
 
5
+ model = GLiNER.from_pretrained("knowledgator/gliner-multitask-v1.0").to('cpu')
6
 
7
  text1 = """
8
  "I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
materials/introduction.html CHANGED
@@ -56,7 +56,7 @@
56
  <li><b>Open Information Extraction:</b> Extracts pieces of text given an open prompt from a user, for example, product description extraction.</li>
57
  </ol>
58
  <h3>What is <a href="https://github.com/urchade/GLiNER">GLiNER</a> HandyLab?</h3>
59
- <p>GLiNER HandyLab serves as a foundational showcase of our technological capabilities within the universal information extraction. It enployes the model <a href="https://huggingface.co/knowledgator/gliner-multitask-large-v0.5">"knowledgator/gliner-multitask-large-v0.5"</a>. GLiNER-Multitask is a model designed to extract various pieces of information from plain text based on a user-provided custom prompt. This versatile model leverages a bidirectional transformer encoder, similar to BERT, which ensures both high generalization and compute efficiency despite its compact size.<p>
60
  <h3>Remember, information extraction is not just about data; it's about insights. Let's uncover those insights together!💫</h3>
61
  <!-- Links Section -->
62
  <div class="links-container">
 
56
  <li><b>Open Information Extraction:</b> Extracts pieces of text given an open prompt from a user, for example, product description extraction.</li>
57
  </ol>
58
  <h3>What is <a href="https://github.com/urchade/GLiNER">GLiNER</a> HandyLab?</h3>
59
+ <p>GLiNER HandyLab serves as a foundational showcase of our technological capabilities within the universal information extraction. It enployes the model <a href="https://huggingface.co/knowledgator/gliner-multitask-v1.0">"knowledgator/gliner-multitask-v1.0"</a>. GLiNER-Multitask is a model designed to extract various pieces of information from plain text based on a user-provided custom prompt. This versatile model leverages a bidirectional transformer encoder, similar to BERT, which ensures both high generalization and compute efficiency despite its compact size.<p>
60
  <h3>Remember, information extraction is not just about data; it's about insights. Let's uncover those insights together!💫</h3>
61
  <!-- Links Section -->
62
  <div class="links-container">