has12zen commited on
Commit
6118d1d
1 Parent(s): 1c13527
assets/text1.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Artificial intelligence (AI) is a rapidly growing field of technology that has the potential to transform the way we live and work. It involves the development of intelligent machines that can perform tasks that normally require human intelligence, such as visual perception, speech recognition, decision-making, and language translation. AI is already being used in a wide range of applications, from virtual assistants like Siri and Alexa to self-driving cars and medical diagnosis.
assets/text10.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ use std::collections::{HashSet, VecDeque};
2
+
3
+ fn topological_sort(graph: &Vec<Vec<usize>>) -> Vec<usize> {
4
+ let mut visited = HashSet::new();
5
+ let mut stack = VecDeque::new();
6
+ let mut result = Vec::new();
7
+
8
+ for node in 0..graph.len() {
9
+ if !visited.contains(&node) {
10
+ dfs(node, graph, &mut visited, &mut stack);
11
+ }
12
+ }
13
+
14
+ while let Some(node) = stack.pop_front() {
15
+ result.push(node);
16
+ }
17
+
18
+ result
19
+ }
20
+
21
+ fn dfs(node: usize, graph: &Vec<Vec<usize>>, visited: &mut HashSet<usize>, stack: &mut VecDeque<usize>) {
22
+ visited.insert(node);
23
+
24
+ for &neighbor in &graph[node] {
25
+ if !visited.contains(&neighbor) {
26
+ dfs(neighbor, graph, visited, stack);
27
+ }
28
+ }
29
+
30
+ stack.push_front(node);
31
+ }
32
+
33
+ fn main() {
34
+ // Example graph with 6 nodes and 7 edges
35
+ let graph = vec![
36
+ vec![1, 2],
37
+ vec![3],
38
+ vec![3, 4],
39
+ vec![4, 5],
40
+ vec![],
41
+ vec![],
42
+ ];
43
+
44
+ let sorted = topological_sort(&graph);
45
+
46
+ println!("Topological sort: {:?}", sorted);
47
+ }
assets/text2.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Artificial intelligence is a fast-developing technology field that has the potential to revolutionize our lives and jobs. It entails building smart machines capable of carrying out tasks that typically necessitate human intelligence, such as visual perception, language translation, decision-making, and speech recognition. AI has been employed in numerous applications, including medical diagnosis, self-driving automobiles, and virtual assistants like Siri and Alexa.
example.txt → assets/text3.txt RENAMED
@@ -1 +1 @@
1
- The benefits of exercise for physical and mental health are well-established. Regular exercise can help reduce the risk of chronic diseases, such as diabetes, heart disease, and cancer, as well as improve mood and cognitive function. However, it's important to choose activities that you enjoy and that are safe for your current level of fitness. Some popular options include walking, running, cycling, swimming, and yoga. Finding a workout buddy or joining a group fitness class can also help keep you motivated and accountable.
 
1
+ The benefits of exercise for physical and mental health are well-established. Regular exercise can help reduce the risk of chronic diseases, such as diabetes, heart disease, and cancer, as well as improve mood and cognitive function. However, it's important to choose activities that you enjoy and that are safe for your current level of fitness. Some popular options include walking, running, cycling, swimming, and yoga. Finding a workout buddy or joining a group fitness class can also help keep you motivated and accountable. This will install the latest version of the Natural Language Toolkit (NLTK) library and download the WordNet corpus, which is used for various natural language processing tasks such as word sense disambiguation and synonymy identification.The impact of technology on our daily lives is undeniable. From the moment we wake up to the time we go to bed, technology is a ubiquitous presence. It has made our lives easier and more convenient, but at the same time, it has also brought about new challenges and concerns. For instance, social media has changed the way we communicate and interact with one another. It has given us the ability to connect with people from all over the world, but it has also led to issues such as cyberbullying, fake news, and information overload. Additionally, the rise of artificial intelligence and automation has led to concerns about job displacement and the need for upskilling and reskilling. Nevertheless, technology continues to advance at a rapid pace, and it is up to us to embrace it responsibly and use it to create a better future.
assets/text4.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Oceans cover more than 70% of the Earth's surface, making them the largest habitat on the planet. They are home to a vast array of plants and animals, from microscopic plankton to massive blue whales. Oceans also play a crucial role in regulating the Earth's climate, absorbing and transporting heat from the equator to the poles. Despite their importance, much of the world's oceans remain unexplored and poorly understood. Pollution, overfishing, and climate change pose major threats to ocean health and the species that call them home. As we continue to learn more about the oceans, it is essential that we take steps to protect and preserve these vital ecosystems.
assets/text5.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ High-speed rail (HSR) is a form of rail transport that operates significantly faster than traditional rail traffic, using an integrated system of specialized rolling stock and dedicated tracks. HSR has become increasingly popular around the world, providing a fast, convenient, and environmentally friendly means of transportation for millions of people.One of the most well-known HSR systems is the Shinkansen in Japan, which began operations in 1964 and has since become a symbol of the country's technological innovation and efficiency. The Shinkansen has since been joined by numerous other HSR systems around the world, including the TGV in France, the ICE in Germany, and the AVE in Spain.HSR has many advantages over traditional rail transport, including faster speeds, shorter travel times, greater capacity, improved safety, and reduced environmental impact. However, HSR systems are also more expensive to build and maintain than traditional rail systems, requiring significant investments in infrastructure, rolling stock, and maintenance facilities.Despite these challenges, HSR is becoming increasingly popular as a means of transportation around the world, with many countries investing in new systems and expanding existing ones. In addition to providing faster, more convenient transportation for millions of people, HSR also has the potential to stimulate economic growth, reduce congestion on roads and in airports, and improve overall quality of life.
assets/text6.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Dinosaurs are a group of extinct reptiles that lived on Earth during the Mesozoic Era, which spanned from about 252 million years ago to 66 million years ago. They were incredibly diverse, ranging in size from tiny creatures no larger than a chicken to massive behemoths like the long-necked Apatosaurus and the fearsome Tyrannosaurus rex.Dinosaurs are often divided into two main groups: the Saurischia and the Ornithischia. The Saurischia included the long-necked sauropods and the meat-eating theropods like T. rex, while the Ornithischia included herbivorous dinosaurs like Triceratops and Stegosaurus.One of the most fascinating things about dinosaurs is their incredible diversity. Some were fast and agile, while others were slow-moving and heavily armored. Some were covered in feathers, while others had tough, scaly skin. Many dinosaurs also had unique adaptations, such as the elongated neck of the Brachiosaurus or the bony plates that lined the back of the Stegosaurus.Dinosaurs are believed to have gone extinct around 66 million years ago, likely as a result of a catastrophic asteroid impact that caused massive climate change and widespread devastation. Despite their extinction, dinosaurs continue to capture our imaginations and inspire awe with their incredible size, strength, and diversity.
assets/text7.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Once upon a time in a small town, there lived a young boy named Nobita who was always getting into trouble. One day, he found a robotic cat named Doraemon in his closet. Doraemon was a magical cat who had all kinds of futuristic gadgets in his pocket.
2
+
3
+ Nobita and Doraemon quickly became best friends and would go on all sorts of exciting adventures together. They went to outer space, traveled through time, and explored the deepest parts of the ocean.
4
+
5
+ One day, Nobita and Doraemon decided to go on a journey to find a legendary treasure. They packed their bags and set off on a long and perilous journey.
6
+
7
+ Along the way, they encountered many obstacles, including treacherous mountains, deep valleys, and dangerous creatures. But with Doraemon's gadgets and Nobita's bravery, they were able to overcome every challenge that came their way.
8
+
9
+ Finally, after many days of travel, they arrived at their destination. There, they found the legendary treasure, which was a magical key that could unlock any door in the world.
10
+
11
+ Nobita and Doraemon were thrilled with their discovery, and they knew that they had to use the key to help others. So they traveled the world, unlocking doors for people who needed help, and spreading joy and happiness wherever they went.
12
+
13
+ And so, Nobita and Doraemon's adventures continued, as they explored the world and helped those in need. They remained best friends forever, and their bond only grew stronger with each passing day.
assets/text8.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Time, the elusive thief,
2
+ Steals moments like a leaf,
3
+ Fleeting, yet ever so true,
4
+ It marches on, without a clue.
5
+
6
+ Time, the silent witness,
7
+ Sees all, yet is helpless,
8
+ It brings joy, it brings pain,
9
+ It's never the same, again and again.
10
+
11
+ Time, the great equalizer,
12
+ No one can escape its razor,
13
+ It erodes all, big or small,
14
+ And leaves behind its indelible call.
15
+
16
+ Time, the infinite mystery,
17
+ With its endless tapestry,
18
+ It weaves our lives, it tells our tale,
19
+ And leaves us with memories to exhale.
20
+
21
+ So cherish every moment,
22
+ For time is never dormant,
23
+ Live your life, love your rhyme,
24
+ And make the most of your time.
assets/text9.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Once upon a time, in a small village nestled in the hills, there lived a young girl named Lila. Lila was a curious girl with a wild spirit, always eager to explore the world around her. She spent most of her days wandering through the fields and forests, taking in the beauty of nature.One day, as Lila was exploring a dense thicket of trees, she stumbled upon a hidden clearing. In the center of the clearing stood a magnificent tree unlike any she had ever seen before. Its branches reached high into the sky, and its leaves shimmered like gold in the sunlight.Lila felt drawn to the tree and approached it with wonder. As she got closer, she noticed a small opening in the trunk. Without hesitation, Lila crawled inside.The inside of the tree was like nothing Lila had ever seen before. It was a magical world filled with sparkling crystals and colorful flowers that glowed in the dark. Lila felt like she had been transported to another world.She spent hours exploring the tree, marveling at its beauty and mystery. As she made her way back out of the trunk and back into the sunlight, Lila felt changed. She knew that she had just experienced something truly special.From that day on, Lila visited the tree often, always finding something new and amazing inside. She realized that the world was full of secrets and wonders, waiting to be discovered by those who are brave enough to seek them out. And so, Lila continued to explore, always eager for her next adventure.
utils.py CHANGED
@@ -11,9 +11,18 @@ nltk.download("wordnet")
11
  # Initialize wordnet lemmatizer
12
  wnl = WordNetLemmatizer()
13
 
14
- file3 = './example.txt'
 
 
 
 
 
 
 
 
 
15
 
16
- files = [file3]
17
 
18
  gist_file = open("gist_stopwords.txt", "r")
19
  try:
 
11
  # Initialize wordnet lemmatizer
12
  wnl = WordNetLemmatizer()
13
 
14
+ file1 = './assets/text1.txt'
15
+ file2 = './assets/text2.txt'
16
+ file3 = './assets/text3.txt'
17
+ file4 = './assets/text4.txt'
18
+ file5 = './assets/text5.txt'
19
+ file6 = './assets/text6.txt'
20
+ file7 = './assets/text7.txt'
21
+ file8 = './assets/text8.txt'
22
+ file9 = './assets/text9.txt'
23
+ file10 = './assets/text10.txt'
24
 
25
+ files = [file1, file2, file3,file4,file5,file6,file7,file8,file9,file10]
26
 
27
  gist_file = open("gist_stopwords.txt", "r")
28
  try: