|
Download ai/ai-0003.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/ai/ai-0003.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm/ai/ai-0003.jsonl
-
curl -L -o ai-0003.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/ai/ai-0003.jsonl
1.9 kB
| {"type": "session", "harness": "deepseek-harness", "id": "ai-0003", "name": "Natural Language Processing basics"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "How do I do NLP with Python?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "```python\n# Tokenization\nfrom transformers import AutoTokenizer\ntokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')\ntokens = tokenizer(\"Hello world!\", return_tensors='pt')\n\n# Text preprocessing\nimport re\ndef preprocess(text):\n text = text.lower()\n text = re.sub(r'[^\\w\\s]', '', text)\n text = re.sub(r'\\s+', ' ', text).strip()\n return text\n\n# Sentiment analysis with transformers\nfrom transformers import pipeline\nclassifier = pipeline('sentiment-analysis')\nresult = classifier(\"I love this product!\")\n# [{'label': 'POSITIVE', 'score': 0.9998}]\n\n# Named Entity Recognition\nner = pipeline('ner', aggregation_strategy='simple')\nentities = ner(\"Apple was founded by Steve Jobs in California\")\n\n# Text generation\ngenerator = pipeline('text-generation', model='gpt2')\ntext = generator(\"The future of AI is\", max_length=50)\n\n# Word embeddings\nfrom gensim.models import Word2Vec\nmodel = Word2Vec(sentences, vector_size=100, window=5, min_count=1)\nvector = model.wv['python']\n\n# TF-IDF\nfrom sklearn.feature_extraction.text import TfidfVectorizer\ntfidf = TfidfVectorizer(max_features=1000)\nX = tfidf.fit_transform(documents)\n```"}} | |