{"id":25054909,"url":"https://github.com/rajapriya12345/labprojects","last_synced_at":"2025-06-17T08:32:54.332Z","repository":{"id":274608811,"uuid":"923402488","full_name":"Rajapriya12345/Labprojects","owner":"Rajapriya12345","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-28T07:12:18.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T07:44:31.746Z","etag":null,"topics":["machine-learning","pytho","r"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rajapriya12345.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-28T07:08:48.000Z","updated_at":"2025-01-28T09:50:26.000Z","dependencies_parsed_at":"2025-01-28T10:47:03.169Z","dependency_job_id":null,"html_url":"https://github.com/Rajapriya12345/Labprojects","commit_stats":null,"previous_names":["rajapriya12345/labprojects"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rajapriya12345/Labprojects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajapriya12345%2FLabprojects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajapriya12345%2FLabprojects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajapriya12345%2FLabprojects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajapriya12345%2FLabprojects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rajapriya12345","download_url":"https://codeload.github.com/Rajapriya12345/Labprojects/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajapriya12345%2FLabprojects/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260321912,"owners_count":22991720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","pytho","r"],"created_at":"2025-02-06T12:19:19.930Z","updated_at":"2025-06-17T08:32:54.280Z","avatar_url":"https://github.com/Rajapriya12345.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"import pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics.pairwise import cosine_similarity\n\n# Sample dataset of text documents\ndata = {\n    \"Document\": [\n        \"Natural Language Processing is a field of AI.\",\n        \"TF-IDF stands for Term Frequency-Inverse Document Frequency.\",\n        \"It is widely used in Information Retrieval and Text Mining.\",\n        \"This is an example of text processing using Python.\",\n        \"Machine Learning and NLP are interconnected fields.\"\n    ]\n}\n\n# Create a DataFrame\ndf = pd.DataFrame(data)\n\n# Step 1: Initialize the TF-IDF Vectorizer\ntfidf_vectorizer = TfidfVectorizer()\n\n# Step 2: Fit and transform the text data\ntfidf_matrix = tfidf_vectorizer.fit_transform(df[\"Document\"])\n\n# Step 3: Display the TF-IDF matrix as a DataFrame\nfeature_names = tfidf_vectorizer.get_feature_names_out()\ntfidf_df = pd.DataFrame(tfidf_matrix.toarray(), columns=feature_names)\nprint(\"TF-IDF Matrix:\")\nprint(tfidf_df)\n\n# Step 4: Query the TF-IDF model\nquery = \"text mining and NLP\"\nquery_vector = tfidf_vectorizer.transform([query])\n\n# Step 5: Compute cosine similarity between the query and documents\nsimilarity_scores = cosine_similarity(query_vector, tfidf_matrix)\n\n# Step 6: Display the similarity scores\ndf[\"Similarity\"] = similarity_scores[0]\nprint(\"\\nDocuments ranked by similarity to the query:\")\nprint(df.sort_values(by=\"Similarity\", ascending=False))\n# Labprojects\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajapriya12345%2Flabprojects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajapriya12345%2Flabprojects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajapriya12345%2Flabprojects/lists"}