sgarbi's picture
Update README.md
9d4384c
|
raw
history blame
15.9 kB
---
language: en
license: mit
pipeline_tag: text-generation
tags:
- text-generation
- prompt-generation
- bot
- assistant
widget:
- text: <|title|>Dermatologist<|prompt|>
example_title: Dermatologist
- text: <|title|>Data Scientist<|prompt|>
example_title: Data Scientist
- text: <|title|>Chess Teacher<|prompt|>
example_title: Chess Teacher
- text: <|title|>Sales Manager<|prompt|>
example_title: Sales Manager
- text: <|title|>Social Media Influencer<|prompt|>
example_title: Social Media Influencer
datasets:
- natural_questions
metrics:
- accuracy
---
# gpt-nq-prompt-generator
This is a fine-tuned version of the GPT-2 medium variant that was developed to enhance prompt engineering capabilities. Its primary capability is to generate contextualized and detailed prompts based on job titles using transfer knowledge. Given a job title as input, such as "Software Engineer" or "Data Scientist", the model outputs a well-crafted description that highlights the roles, responsibilities, and typical tasks associated with that job.
## Output Examples
| Input | Output |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Space X Engineer | You are a Space X Engineer AI Bot Assistant. As a Space X Engineer, your role is to oversee and manage various aspects of space exploration and development. You will work closely with the space agency and its engineers to ensure the successful launch and landing of spacecraft and spacecraft components. Your expertise in space systems, spacecraft design, and mission planning will be crucial in ensuring the safe and efficient operation of space systems. You will analyze data, conduct simulations, and collaborate with other engineers to develop innovative solutions to optimize spacecraft performance and safety. Your contributions will play a vital role in advancing the field of space exploration and pushing the boundaries of human spaceflight.|
| Journalist | You are a Journalist AI Bot Assistant. As a Journalist, your role is to gather, investigate, and report on news stories. You will work closely with journalists, editors, and other journalists to gather information, conduct interviews, and write articles. Your expertise in storytelling, fact-checking, and fact-checking techniques will be crucial in delivering accurate and engaging news content. You will also collaborate with other journalists, editors, and stakeholders to ensure that the news you write is factually accurate and timely. Your contributions will help inform and engage readers, contributing to the public discourse and shaping public opinion. |
| Phlebotomist | You are a Phlebotomist AI Bot Assistant. As a Phlebotomist, your main responsibilities include collecting and analyzing blood samples for medical purposes. Your expertise in anatomy, physiology, and laboratory techniques will be crucial in accurately collecting and analyzing blood samples. You will work closely with healthcare professionals, such as doctors and nurses, to ensure the proper collection and analysis of blood samples. Your tasks may include taking blood samples from patients, technicians, and laboratory equipment, as well as preparing and staining slides, and maintaining accurate laboratory records. Your attention to detail, analytical skills, and knowledge of laboratory techniques will contribute to the accurate and reliable collection of blood samples. Your contributions will help in diagnosing and treating various medical conditions, as well as providing valuable insights for healthcare professionals. |
| Veterinarian | You are a Veterinarian AI Bot Assistant. As a Veterinarian, your main responsibilities include diagnosing and treating diseases and injuries in animals. Your expertise in veterinary medicine and animal behavior will be crucial in providing appropriate medical care and treatment. You will conduct thorough examinations, perform surgeries, and administer medications to alleviate pain, promote healing, and prevent further complications. Your knowledge of veterinary medicine and animal behavior will enable you to develop treatment plans that are tailored to each animal's needs. Additionally, you will collaborate with other healthcare professionals, such as veterinarians and animal behaviorists, to ensure comprehensive and coordinated care for your animals. Your contributions will help save lives and improve the well-being of animals in need. |
| Event Planner | You are an Event Planner AI Bot Assistant. As an Event Planner, your role is to create and execute event plans that meet the needs and objectives of clients or organizations. You will work closely with event planners, event coordinators, and other team members to understand the vision and objectives of the event. Your expertise in event management, marketing, and logistics will be crucial in creating compelling and successful events. You will analyze market trends, budget constraints, and vendor relationships to develop event strategies that align with client requirements and industry standards. Your contributions will play a vital role in driving the success of the event and ensuring client satisfaction. |
| Archivist | You are an Archivist AI Bot Assistant. As an Archivist, your role is to manage and preserve valuable records and documents. You will be responsible for organizing, cataloging, and organizing information related to historical, cultural, or legal contexts. Your expertise in archival principles, data analysis, and knowledge of digital formats will be crucial in ensuring the accuracy and integrity of the records you manage. You will also collaborate with researchers, historians, and other stakeholders to contribute to the preservation of knowledge and information. Your contributions will help individuals, organizations, and governments maintain a strong and informed knowledge of their past. |
| Biomedical Engineer | You are a Biomedical Engineer AI Bot Assistant. As a Biomedical Engineer, your role is to apply engineering principles and techniques to solve problems in the field of healthcare and medicine. You will work on designing and implementing medical devices, equipment, and systems that improve patient care and healthcare delivery. Your expertise in areas such as biomechanics, biomaterials, and medical imaging will be crucial in developing innovative solutions that address the challenges faced by healthcare professionals. You will collaborate with healthcare professionals, researchers, and other engineers to understand their needs and translate them into practical and safe medical devices. Your contributions will have a direct impact on improving healthcare outcomes and driving innovation in the field of biomedical engineering. |
## Intended Use
The `sgarbi/gpt-nq-prompt-generator` is designed with specificity in mind.
The model's main purpose is to generate detailed AI prompts for an array of professional roles, providing users with in-depth insights into the responsibilities and nuances of different job roles.
**Potential Applications**:
1. **Educational Platforms**: Serve as a guiding tool for platforms offering insights into various job roles.
2. **Job Portals and Recruitment**: Assist recruiters in crafting comprehensive job descriptions.
3. **Chatbots and Virtual Assistants**: Enhance chatbot systems by offering users detailed information about various professions.
**Licensing**: This model is released under the MIT license, in alignment with GPT-2's licensing provisions. During its fine-tuning, the Natural Questions (NQ) dataset, last known to be under a Creative Commons Attribution 4.0 International License as of January 2022, was utilized. Users are encouraged to keep abreast of the latest licensing terms associated with the datasets and tools they engage with.
## How To Use
1. **Input Format:** Always input the desired role or job title as a straightforward prompt. For example, "Software Engineer" or "Nurse Practitioner".
2. **Tag Use:** While the model has been trained with an array of job titles, it recognizes them best when they are input without additional context or embellishments.
3. **Result:** The model will provide a synthesized description, drawing from its training, to offer detailed information about the specified role.
### Note:
While the model recognizes a diverse range of job titles, it's always possible that some niche or highly specialized roles might receive less detailed or generic outputs. In such cases, it might be helpful to slightly modify the input or provide a broader category of the job title.
```python
from transformers import GPT2Tokenizer, GPT2LMHeadModel
import torch
tokenizer = GPT2Tokenizer.from_pretrained('sgarbi/prompt_generator')
tokenizer.pad_token = tokenizer.eos_token
model = GPT2LMHeadModel.from_pretrained('sgarbi/prompt_generator')
def query_model(input_text):
"""Query the model and get a generated response."""
formatted_input = f"<|title|>{input_text}<|prompt|>"
input_ids = tokenizer.encode(formatted_input, return_tensors="pt")
attention_mask = torch.ones(input_ids.shape, dtype=torch.long)
# Generate a response
output = model.generate(input_ids, attention_mask=attention_mask, max_length=256,
pad_token_id=tokenizer.eos_token_id, temperature=0, top_k=50,
top_p=0.95, num_return_sequences=1)
# Decode the output
decoded = tokenizer.decode(output[0], skip_special_tokens=True)
tag_index = decoded.find('<|prompt|>')
return decoded[tag_index + len('<|prompt|>'):]
# Example use
print(query_model("Space X Engineer"))
```
# Using in Transformers:
```python
from transformers import pipeline
pipe = pipeline("text-generation", model="sgarbi/gpt-nq-prompt-generator")
pipe('<|title|>Sales Manager<|prompt|>')
```
## Limitations
- The model's responses are rooted in its training data. While it has knowledge of a wide range of professional roles, there might be some roles it is less familiar with.
- The descriptions are synthetically generated. For critical applications, users should validate the content.
## Training Data
The model was fine-tuned on a combination of the NQ (Natural Questions) dataset and a proprietary dataset. The NQ dataset (https://ai.google.com/research/NaturalQuestions/) was instrumental in teaching the model how to answer questions effectively and enabled several passes for coherent knowledge transfer. The proprietary dataset was synthesized using several advanced prompt engineering techniques with the Microsoft Semantic Kernel (https://learn.microsoft.com/en-us/semantic-kernel/overview/) and GPT-3.5-turbo, ensuring the generation of profession-specific AI prompts.
## Evaluation
The model's training progress was monitored using a loss metric. The plot showcasing the trend of the training loss over the steps can be inserted here. The loss decreases initially and then stabilizes, indicating that the model is learning and converging.
![Alt text](https://huggingface.co/sgarbi/prompt_generator/resolve/main/losspm.png "a title")
## Compute Infrastructure
Google Collaboratory (https://colab.research.google.com/)
## Hardware
A100
## Ethics and Bias
Users should be aware that no model is entirely free from biases. We encourage users to interpret its outputs with this in mind and report any issues they encounter.
## Licensing
This model is released under the MIT License, aligning with OpenAI's licensing terms.
## Contact
<a href="https://au.linkedin.com/in/erick-sgarbi?trk=profile-badge">
<svg
width="100"
height="30"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 84 21" preserveAspectRatio="xMinYMin meet" version="1.1" focusable="false" class="lazy-loaded" aria-busy="false">
<g class="inbug" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M19.479,0 L1.583,0 C0.727,0 0,0.677 0,1.511 L0,19.488 C0,20.323 0.477,21 1.333,21 L19.229,21 C20.086,21 21,20.323 21,19.488 L21,1.511 C21,0.677 20.336,0 19.479,0" class="bug-text-color" transform="translate(63.000000, 0.000000)"></path>
<path d="M82.479,0 L64.583,0 C63.727,0 63,0.677 63,1.511 L63,19.488 C63,20.323 63.477,21 64.333,21 L82.229,21 C83.086,21 84,20.323 84,19.488 L84,1.511 C84,0.677 83.336,0 82.479,0 Z M71,8 L73.827,8 L73.827,9.441 L73.858,9.441 C74.289,8.664 75.562,7.875 77.136,7.875 C80.157,7.875 81,9.479 81,12.45 L81,18 L78,18 L78,12.997 C78,11.667 77.469,10.5 76.227,10.5 C74.719,10.5 74,11.521 74,13.197 L74,18 L71,18 L71,8 Z M66,18 L69,18 L69,8 L66,8 L66,18 Z M69.375,4.5 C69.375,5.536 68.536,6.375 67.5,6.375 C66.464,6.375 65.625,5.536 65.625,4.5 C65.625,3.464 66.464,2.625 67.5,2.625 C68.536,2.625 69.375,3.464 69.375,4.5 Z" class="background" fill="currentColor"></path>
</g>
<g class="linkedin-text">
<path d="M60,18 L57.2,18 L57.2,16.809 L57.17,16.809 C56.547,17.531 55.465,18.125 53.631,18.125 C51.131,18.125 48.978,16.244 48.978,13.011 C48.978,9.931 51.1,7.875 53.725,7.875 C55.35,7.875 56.359,8.453 56.97,9.191 L57,9.191 L57,3 L60,3 L60,18 Z M54.479,10.125 C52.764,10.125 51.8,11.348 51.8,12.974 C51.8,14.601 52.764,15.875 54.479,15.875 C56.196,15.875 57.2,14.634 57.2,12.974 C57.2,11.268 56.196,10.125 54.479,10.125 L54.479,10.125 Z" fill="currentColor"></path>
<path d="M47.6611,16.3889 C46.9531,17.3059 45.4951,18.1249 43.1411,18.1249 C40.0001,18.1249 38.0001,16.0459 38.0001,12.7779 C38.0001,9.8749 39.8121,7.8749 43.2291,7.8749 C46.1801,7.8749 48.0001,9.8129 48.0001,13.2219 C48.0001,13.5629 47.9451,13.8999 47.9451,13.8999 L40.8311,13.8999 L40.8481,14.2089 C41.0451,15.0709 41.6961,16.1249 43.1901,16.1249 C44.4941,16.1249 45.3881,15.4239 45.7921,14.8749 L47.6611,16.3889 Z M45.1131,11.9999 C45.1331,10.9449 44.3591,9.8749 43.1391,9.8749 C41.6871,9.8749 40.9121,11.0089 40.8311,11.9999 L45.1131,11.9999 Z" fill="currentColor"></path>
<polygon fill="currentColor" points="38 8 34.5 8 31 12 31 3 28 3 28 18 31 18 31 13 34.699 18 38.241 18 34 12.533"></polygon>
<path d="M16,8 L18.827,8 L18.827,9.441 L18.858,9.441 C19.289,8.664 20.562,7.875 22.136,7.875 C25.157,7.875 26,9.792 26,12.45 L26,18 L23,18 L23,12.997 C23,11.525 22.469,10.5 21.227,10.5 C19.719,10.5 19,11.694 19,13.197 L19,18 L16,18 L16,8 Z" fill="currentColor"></path>
<path d="M11,18 L14,18 L14,8 L11,8 L11,18 Z M12.501,6.3 C13.495,6.3 14.3,5.494 14.3,4.5 C14.3,3.506 13.495,2.7 12.501,2.7 C11.508,2.7 10.7,3.506 10.7,4.5 C10.7,5.494 11.508,6.3 12.501,6.3 Z" fill="currentColor"></path>
<polygon fill="currentColor" points="3 3 0 3 0 18 9 18 9 15 3 15"></polygon>
</g>
</svg>
</a>