Spaces:
Sleeping
Sleeping
| <<<<<<< HEAD | |
| # ICD-CPT Model | |
| This project implements a FastAPI application that utilizes the Groq API and a language model (Llama 3.3 70b Versatile) to provide CPT and ICD coding based on provider notes. The application is designed to return structured JSON responses that include the predicted codes along with explanations for each code. | |
| ## Project Structure | |
| - **src/**: Contains the main application code. | |
| - **main.py**: Entry point for the FastAPI application. | |
| - **api/**: Contains API route definitions. | |
| - **routes.py**: Defines the endpoints for the application. | |
| - **services/**: Contains service logic for interacting with external APIs. | |
| - **groq_service.py**: Handles requests to the Groq API and processes responses. | |
| - **models/**: Contains data models for requests and responses. | |
| - **request_models.py**: Defines request models for incoming data. | |
| - **response_models.py**: Defines response models for outgoing data. | |
| - **config/**: Contains configuration settings for the application. | |
| - **settings.py**: Configuration for API keys and model IDs. | |
| - **utils/**: Contains utility functions and prompt templates. | |
| - **prompts.py**: Defines prompt templates for querying the model. | |
| - **tests/**: Contains unit tests for the application. | |
| - **test_api.py**: Tests for API endpoints. | |
| - **requirements.txt**: Lists the dependencies required for the project. | |
| - **.env.example**: Template for environment variables. | |
| - **.gitignore**: Specifies files to be ignored by Git. | |
| - **Dockerfile**: Instructions for building a Docker image for the application. | |
| ## Setup Instructions | |
| 1. **Clone the Repository**: | |
| Clone the repository to your local machine. | |
| 2. **Create a Virtual Environment**: | |
| Create a virtual environment to manage dependencies. | |
| ``` | |
| python -m venv venv | |
| ``` | |
| 3. **Activate the Virtual Environment**: | |
| Activate the virtual environment. | |
| - On Windows: | |
| ``` | |
| venv\Scripts\activate | |
| ``` | |
| - On macOS/Linux: | |
| ``` | |
| source venv/bin/activate | |
| ``` | |
| 4. **Install Dependencies**: | |
| Install the required dependencies using pip. | |
| ``` | |
| pip install -r requirements.txt | |
| ``` | |
| 5. **Set Up Environment Variables**: | |
| Copy `.env.example` to `.env` and fill in the necessary values, including the Groq API key and model ID. | |
| 6. **Run the Application**: | |
| Start the FastAPI application. | |
| ``` | |
| uvicorn src.main:app --reload | |
| ``` | |
| ## Usage | |
| - **Endpoint**: `/api/coding` | |
| - **Method**: `POST` | |
| - **Request Body**: | |
| ```json | |
| { | |
| "provider_notes": "Your provider notes here." | |
| } | |
| ``` | |
| - **Response**: | |
| ```json | |
| { | |
| "icd_codes": [ | |
| { | |
| "code": "ICD_CODE_1", | |
| "explanation": "Explanation for ICD_CODE_1" | |
| } | |
| ], | |
| "cpt_codes": [ | |
| { | |
| "code": "CPT_CODE_1", | |
| "explanation": "Explanation for CPT_CODE_1" | |
| } | |
| ] | |
| } | |
| ``` | |
| ## Deployment | |
| For deployment, you can use Docker to containerize the application. Follow the instructions in the Dockerfile to build and run the application in a containerized environment. | |
| ## License | |
| This project is licensed under the MIT License. See the LICENSE file for more details. | |
| ======= | |
| --- | |
| title: Icd Cpt Coding Api | |
| emoji: π | |
| colorFrom: indigo | |
| colorTo: indigo | |
| sdk: docker | |
| pinned: false | |
| --- | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
| >>>>>>> cc72a56032827788eed3105a0ef90e037552e5a7 | |