fart2 commited on
Commit
958786b
1 Parent(s): 6010473

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -3
README.md CHANGED
@@ -13,7 +13,9 @@ This model fine-tunes google/t5-base to convert job descriptions into structured
13
  This model is based on the T5-base architecture fine-tuned on a dataset of 10,000 job description and resume pairs. It takes a job description as input and generates a JSON representation of a resume tailored to that job.
14
 
15
  **Base model:** google/t5-base
 
16
  **Fine-tuning task:** Text-to-JSON conversion
 
17
  **Training data:** 10,000 job description and resume pairs
18
 
19
  ## Intended uses & limitations
@@ -27,6 +29,7 @@ This model is based on the T5-base architecture fine-tuned on a dataset of 10,00
27
  - The model's output quality depends on the input job description's detail and clarity
28
  - Generated resumes may require human review and editing
29
  - The model may not capture nuanced or industry-specific requirements
 
30
 
31
  ## Training data
32
 
@@ -36,9 +39,58 @@ The model was trained on 10,000 pairs of job descriptions and corresponding resu
36
 
37
  The model was fine-tuned using the standard T5 text-to-text framework. Specific hyperparameters and training details are not provided.
38
 
39
- ## Evaluation results
40
-
41
- Evaluation metrics and results are not specified. Users are encouraged to evaluate the model's performance on their specific use cases.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  ## Ethical considerations
44
 
 
13
  This model is based on the T5-base architecture fine-tuned on a dataset of 10,000 job description and resume pairs. It takes a job description as input and generates a JSON representation of a resume tailored to that job.
14
 
15
  **Base model:** google/t5-base
16
+
17
  **Fine-tuning task:** Text-to-JSON conversion
18
+
19
  **Training data:** 10,000 job description and resume pairs
20
 
21
  ## Intended uses & limitations
 
29
  - The model's output quality depends on the input job description's detail and clarity
30
  - Generated resumes may require human review and editing
31
  - The model may not capture nuanced or industry-specific requirements
32
+ - The model is not tokenized to output "{" or "}", and instead uses "RB>" and "LB>" respectively
33
 
34
  ## Training data
35
 
 
39
 
40
  The model was fine-tuned using the standard T5 text-to-text framework. Specific hyperparameters and training details are not provided.
41
 
42
+ # How to Get Started with the Model
43
+
44
+ Use the code below to get started with the model.
45
+
46
+ <details>
47
+ <summary> Click to expand </summary>
48
+
49
+ ```python
50
+ from transformers import T5Tokenizer, T5ForConditionalGeneration
51
+
52
+ def load_model_and_tokenizer(model_path):
53
+ """
54
+ Load the tokenizer and model from the specified path.
55
+ """
56
+ tokenizer = T5Tokenizer.from_pretrained("google-t5/t5-base")
57
+ model = T5ForConditionalGeneration.from_pretrained(model_path)
58
+ return tokenizer, model
59
+
60
+ def generate_text(prompt, tokenizer, model):
61
+ """
62
+ Generate text using the model based on the given prompt.
63
+ """
64
+ # Encode the input prompt to get the tensor
65
+ input_ids = tokenizer(prompt, return_tensors="pt", padding=True).input_ids
66
+
67
+ # Generate the output using the model
68
+ outputs = model.generate(input_ids, max_length=512, num_return_sequences=1)
69
+
70
+ # Decode the output tensor to human-readable text
71
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
72
+ return generated_text
73
+
74
+ def main():
75
+ model_path = "nakamoto-yama/t5-resume-generation"
76
+ print(f"Loading model and tokenizer from {model_path}")
77
+ tokenizer, model = load_model_and_tokenizer(model_path)
78
+
79
+ # Test the model with a prompt
80
+ while True:
81
+ prompt = input("Enter a job description or title: ")
82
+ if prompt.lower() == 'exit':
83
+ break
84
+ response = generate_text(f"generate resume JSON for the following job: {prompt}", tokenizer, model)
85
+ response = response.replace("LB>", "{").replace("RB>", "}")
86
+ print(f"Generated Response: {response}")
87
+
88
+ if __name__ == "__main__":
89
+ main()
90
+ ```
91
+
92
+ See the [Hugging Face T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Model) docs and a [Colab Notebook](https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb) created by the model developers for more examples.
93
+ </details>
94
 
95
  ## Ethical considerations
96