Download CLAUDE.md from UFOSINT/UAP-Data-Analysis-Tool: direct link, hf CLI and curl.
- Browser
- Download file 4.31 kB
-
https://huggingface.co/spaces/UFOSINT/UAP-Data-Analysis-Tool/resolve/main/CLAUDE.md
- Command line
-
hf download hf://spaces/UFOSINT/UAP-Data-Analysis-Tool/CLAUDE.md
-
curl -L -o CLAUDE.md https://huggingface.co/spaces/UFOSINT/UAP-Data-Analysis-Tool/resolve/main/CLAUDE.md
A newer version of the Streamlit SDK is available: 1.68.0
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
UAP-Data-Analysis-Tool (also known as UFOSINT) is a Streamlit-based data analysis application for UFO/UAP (Unidentified Aerial Phenomena) sighting reports. It provides text parsing, clustering, statistical analysis, geospatial visualization, and magnetic anomaly correlation capabilities.
Commands
Running the Application
# Streamlit app (main interface)
uv run streamlit run app.py
# Gradio app (alternative interface)
uv run gradio gradio_app.py
Dependency Management
# Install dependencies using uv (Python 3.12+)
uv sync
# Or using pip
pip install -r requirements.txt
Testing/Running Individual Pages
Each Streamlit page can be tested individually:
uv run streamlit run parsing.py
uv run streamlit run analyzing.py
uv run streamlit run rag_search.py
uv run streamlit run magnetic.py
uv run streamlit run map.py
Architecture
Core Analysis Pipeline
The application follows a multi-step NLP analysis pipeline:
Parsing (
parsing.py) - Uses OpenAI GPT-4o-mini to extract structured JSON features from raw UAP report text. The JSON schema is defined inconfig.py(FORMAT_LONG).Analysis (
analyzing.py) - Performs dimensionality reduction (UMAP) and clustering (HDBSCAN) on text embeddings, then trains XGBoost classifiers to identify feature correlations.RAG Search (
rag_search.py) - Implements semantic search using Cohere's rerank API to find relevant reports based on natural language queries.Magnetic Analysis (
magnetic.py) - Correlates UAP sightings with InterMagnet station data using Dynamic Time Warping (FastDTW).Map Visualization (
map.py) - Interactive Kepler.gl maps showing sighting locations with proximity analysis to military bases and nuclear facilities.
Key Classes (uap_analyzer.py)
UAPParser- Concurrent OpenAI API calls for JSON extraction with exponential backoffUAPAnalyzer- Text embedding (sentence-transformers/e5-large-v2), UMAP reduction, HDBSCAN clustering, TF-IDF cluster naming, cluster merging via cosine similarityUAPVisualizer- XGBoost prediction plots, confusion matrices, Cramer's V heatmaps, treemaps
Utils Module (utils/)
Enhanced utilities providing:
DataProcessor- DataFrame filtering with Streamlit UIUAP_Visualizer- Interactive Plotly visualizationsSessionStateManager- Streamlit session state handlingEmbeddingCacheManager- Caches sentence-transformer embeddings to avoid recomputationMemoryManager- GPU memory management for CUDA operationsUAP_Pipeline- End-to-end analysis pipeline orchestration
Data Flow
Raw Text Reports (CSV/XLSX)
βββ parsing.py (GPT-4o-mini) β Structured JSON
βββ analyzing.py β Embeddings β UMAP β HDBSCAN clusters
βββ XGBoost predictions + Cramer's V correlations
βββ map.py (Kepler.gl visualization)
Session State Keys
The app uses Streamlit session state extensively. Key variables:
parsed_responses/parsed_responses_df- Parsed JSON dataanalyzers/clusters/col_names- Analysis resultsstage- UI workflow stateapi_key_valid- OpenAI key validation status
Configuration
API Keys
Secrets are stored in .streamlit/secrets.toml (not committed). Required keys:
OPENAI_KEY- For GPT-4o-mini parsingGEMINI_KEY- For Gemini Pro summarizationCOHERE_KEY- For rerank search
Data Files
final_ufoseti_dataset.h5- Pre-parsed UAP datasetparsed_files_distance_embeds.h5- Dataset with embeddingsglobal_power_plant_database.csv- Nuclear facility locationssecret_bases.csv- Military base locations*.kgl- Kepler.gl map configuration files
GPU Requirements
The embedding model (embaas/sentence-transformers-e5-large-v2) and XGBoost run on CUDA by default. The code includes torch.cuda.empty_cache() calls for memory management.
HuggingFace Deployment
The app is configured for HuggingFace Spaces deployment (see README.md metadata). The sdk_version: 1.36.0 specifies the Streamlit version.