pszemraj commited on
Commit
02b31a8
·
verified ·
1 Parent(s): b6a69ce

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -9
README.md CHANGED
@@ -21,29 +21,43 @@ It achieves the following results on the evaluation set:
21
  - Loss: 0.7894
22
  - Num Input Tokens Seen: 14258488
23
 
 
 
 
 
 
24
  ```py
25
  import torch
26
  from transformers import pipeline
27
 
28
  model_name = "pszemraj/bart-large-summary-map-reduce-1024"
29
- # model_name = "pszemraj/flan-t5-large-summary-map-reduce-1024"
30
 
31
- pipe = pipeline("text2text-generation", model=model_name, device_map="auto")
 
 
 
 
32
 
33
  # examples
34
- text = """A computer implemented method of generating a syntactic object. The method includes the steps of providing a plurality of input data sets, each input data set comprising one or more words, wherein each word is associated with at least one non-adjacent second word; creating an exocentric relationship between the first and second words by applying a neo-ian event semantics to the input data in such a way that the neo-antagonistic effect results in the generation of the syntactic object; and storing the generated syntactic object for future use.
35
- A method of learning and using language is disclosed. The method includes the steps of creating a lexicon of words, wherein each word in the lexicon has at least two possible states, selecting a set of one or more of the possible states of the lexicon to be used as a base state for a subsequent computational operation, and applying the computational operation to the base state to form a new output state.
36
- A computer implemented method for changing a first workspace to a second workspace. The method includes the steps of creating a new workspace by merging the first workspace with the second workspace, wherein the merging is based on at least one of: an impenetrable condition; a constraint on movement; and a resource restriction.
37
- The brain is constantly loosing neurons because you doesn't want all the junk around."""
38
-
39
  text = """"Sangers on a Train" is a 1950 film about a train driver, Guy Haines, who discovers his wife, Miriam, has been murdered in Metcalf, Washington, DC. The film delves into the relationship between Guy and Anne Burton, focusing on Guy's desire for Anne to marry him.
40
  "Screentalk" is a comedy about Anne Burton and her husband, Guy Haines, who are investigating the murder of their daughter, Miriam. The plot revolves around Anne's relationship with Bruno, who has been arrested for his wife's murder. In the second set, Guy and Anne meet at a tennis court in Washington, DC, where they plan to play against each other. Hennessy and Hammond investigate the crime scene, leading to Guy's arrest.
41
  "The Announcer's Boom Forest Hills" is a tennis game between Guy Haines and Bruno Antony, with the score six-five. In the second set, Haines leads three games to four, but his opponent, Bernard Reynolds, attacks him in the third set. Meanwhile, Anne Hennessy and Barbara Hammond are preparing for dinner at the amusement park, where Guy has been waiting for hours. A police car arrives, followed by a taxi. The boatman and detectives follow Guy through the queue, leading to the conclusion that Guy was the man responsible for the accident."""
42
 
 
 
 
 
43
 
 
44
  torch.cuda.empty_cache()
45
- res = pipe(text, max_new_tokens=512, num_beams=4, early_stopping=True)
46
- res[0]["generated_text"]
 
 
 
 
 
 
47
  ```
48
 
49
  ## Training procedure
 
21
  - Loss: 0.7894
22
  - Num Input Tokens Seen: 14258488
23
 
24
+
25
+ ## usage
26
+
27
+ an example of aggregating summaries from chunks of a long document:
28
+
29
  ```py
30
  import torch
31
  from transformers import pipeline
32
 
33
  model_name = "pszemraj/bart-large-summary-map-reduce-1024"
 
34
 
35
+ pipe = pipeline(
36
+ "text2text-generation",
37
+ model=model_name,
38
+ device_map="auto",
39
+ )
40
 
41
  # examples
 
 
 
 
 
42
  text = """"Sangers on a Train" is a 1950 film about a train driver, Guy Haines, who discovers his wife, Miriam, has been murdered in Metcalf, Washington, DC. The film delves into the relationship between Guy and Anne Burton, focusing on Guy's desire for Anne to marry him.
43
  "Screentalk" is a comedy about Anne Burton and her husband, Guy Haines, who are investigating the murder of their daughter, Miriam. The plot revolves around Anne's relationship with Bruno, who has been arrested for his wife's murder. In the second set, Guy and Anne meet at a tennis court in Washington, DC, where they plan to play against each other. Hennessy and Hammond investigate the crime scene, leading to Guy's arrest.
44
  "The Announcer's Boom Forest Hills" is a tennis game between Guy Haines and Bruno Antony, with the score six-five. In the second set, Haines leads three games to four, but his opponent, Bernard Reynolds, attacks him in the third set. Meanwhile, Anne Hennessy and Barbara Hammond are preparing for dinner at the amusement park, where Guy has been waiting for hours. A police car arrives, followed by a taxi. The boatman and detectives follow Guy through the queue, leading to the conclusion that Guy was the man responsible for the accident."""
45
 
46
+ text = """A computer implemented method of generating a syntactic object. The method includes the steps of providing a plurality of input data sets, each input data set comprising one or more words, wherein each word is associated with at least one non-adjacent second word; creating an exocentric relationship between the first and second words by applying a neo-ian event semantics to the input data in such a way that the neo-antagonistic effect results in the generation of the syntactic object; and storing the generated syntactic object for future use.
47
+ A method of learning and using language is disclosed. The method includes the steps of creating a lexicon of words, wherein each word in the lexicon has at least two possible states, selecting a set of one or more of the possible states of the lexicon to be used as a base state for a subsequent computational operation, and applying the computational operation to the base state to form a new output state.
48
+ A computer implemented method for changing a first workspace to a second workspace. The method includes the steps of creating a new workspace by merging the first workspace with the second workspace, wherein the merging is based on at least one of: an impenetrable condition; a constraint on movement; and a resource restriction.
49
+ The brain is constantly loosing neurons because you doesn't want all the junk around."""
50
 
51
+ # generate
52
  torch.cuda.empty_cache()
53
+ res = pipe(
54
+ text,
55
+ max_new_tokens=512,
56
+ num_beams=4,
57
+ early_stopping=True,
58
+ truncation=True,
59
+ )
60
+ print(res[0]["generated_text"])
61
  ```
62
 
63
  ## Training procedure